This is an archive of the discontinued LLVM Phabricator instance.

Export snprintf to avoid linking error with liblldb on Windows.
ClosedPublic

Authored by chaoren on Aug 11 2015, 4:45 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

chaoren updated this revision to Diff 31884.Aug 11 2015, 4:45 PM
chaoren retitled this revision from to Export snprintf to avoid linking error with liblldb on Windows..
chaoren updated this object.
chaoren added reviewers: zturner, ovyalov.
chaoren added a subscriber: lldb-commits.
ovyalov accepted this revision.Aug 11 2015, 6:21 PM
ovyalov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Aug 11 2015, 6:21 PM
This revision was automatically updated to reflect the committed changes.
zturner edited edge metadata.Aug 11 2015, 6:27 PM
zturner added a subscriber: zturner.

You need to use LIBLLDB_API instead of __declspec(export). Otherwise
someone linking against liblldb and trying to call this won't work
correctly. Check the annotation given to the classes in the SB headers for
the exact name of the macro.

Sorry! I'll fix this as soon as I get home.

I have a question though, isn't this only a problem if whatever's linking
against lldb includes this header? This isn't in the API, so that shouldn't
happen. I also don't know if it's correct to label it LLDB_API when it's
not actually part of the API.

True that it only needs to be included if it's part of the api. Are we
sure it can't happen through a transitive include?

As long as the user of liblldb doesn't see the declaration it shouldn't be
a problem.