-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Possibly fix some of the linker errors
Signed-off-by: Scott Wilson <[email protected]>
- Loading branch information
1 parent
2739199
commit 8ee921e
Showing
6 changed files
with
68 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,59 @@ | ||
#pragma once | ||
|
||
#define OPENCHECKS_NAMESPACE openchecks | ||
|
||
/// Borrowed from OpenImageIO's export.h | ||
/// | ||
/// On Windows, when compiling code that will end up in a DLL, symbols | ||
/// must be marked as 'exported' (i.e. __declspec(dllexport)) or they | ||
/// won't be visible to programs linking against the DLL. | ||
/// | ||
/// In addition, when compiling the application code that calls the DLL, | ||
/// if a routine is marked as 'imported' (i.e. __declspec(dllimport)), | ||
/// the compiler can be smart about eliminating a level of calling | ||
/// indirection. But you DON'T want to use __declspec(dllimport) when | ||
/// calling a function from within its own DLL (it will still compile | ||
/// correctly, just not with maximal efficiency). Which is quite the | ||
/// dilemma since the same header file is used by both the library and | ||
/// its clients. Sheesh! | ||
/// | ||
/// But on Linux/OSX as well, we want to only have the DSO export the | ||
/// symbols we designate as the public interface. So we link with | ||
/// -fvisibility=hidden to default to hiding the symbols. See | ||
/// http://gcc.gnu.org/wiki/Visibility | ||
/// | ||
/// We solve this awful mess by defining these macros: | ||
/// | ||
/// OPENCHECKS_API - used for the OpenChecks public API. Normally, assumes | ||
/// that it's being seen by a client of the library, and | ||
/// therefore declare as 'imported'. But if | ||
/// OPENCHECKS_EXPORT is defined (as is done by CMake | ||
/// when compiling the library itself), change the | ||
/// declaration to 'exported'. | ||
/// OPENCHECKS_EXPORT - explicitly exports a symbol that isn't part of the | ||
/// public API but still needs to be visible. | ||
/// OPENCHECKS_LOCAL - explicitly hides a symbol that might otherwise be | ||
/// exported | ||
/// | ||
/// | ||
|
||
#if defined(_WIN32) || defined(__CYGWIN__) | ||
#ifdef OPENCHECKS_STATIC | ||
#define OPENCHECKS_IMPORT | ||
#define OPENCHECKS_EXPORT | ||
#else | ||
#define OPENCHECKS_IMPORT __declspec(dllimport) | ||
#define OPENCHECKS_EXPORT __declspec(dllexport) | ||
#endif | ||
#define OPENCHECKS_LOCAL | ||
#else | ||
#define OPENCHECKS_IMPORT __attribute__((visibility("default"))) | ||
#define OPENCHECKS_EXPORT __attribute__((visibility("default"))) | ||
#define OPENCHECKS_LOCAL __attribute__((visibility("hidden"))) | ||
#endif | ||
|
||
#define OPENCHECKS_API OPENCHECKS_EXPORT | ||
// #if defined(OPENCHECKS_EXPORTS) | ||
// #else | ||
// #define OPENCHECKS_API OPENCHECKS_IMPORT | ||
// #endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters