Skip to content

stdlib: COFF variant of "visibility" macro #3063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions stdlib/public/SwiftShims/Visibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,16 @@
# define SWIFT_RUNTIME_EXPORT __attribute__((__visibility__("default")))
#endif

#elif __CYGWIN__
# define SWIFT_RUNTIME_EXPORT
#else
// __dllexport/__dllimport for Windows?
# error "Unimplemented object format"
# if defined(__CYGWIN__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not #elif and keep the #error?

Copy link
Member Author

@compnerd compnerd Jun 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the commit message, there is no preprocessing macro to identify COFF. __MACH__ identifies MachO, __ELF__ identifies ELF. Since LLVM only supports those three, make neither of them assume COFF.

# define SWIFT_RUNTIME_EXPORT
# else
# if defined(__SWIFT_CURRENT_DYLIB)
# define SWIFT_RUNTIME_EXPORT __declspec(dllexport)
# else
# define SWIFT_RUNTIME_EXPORT
# endif
# endif
#endif

/// Attribute for runtime-stdlib SPI interfaces.
Expand Down