|
61 | 61 | // |
62 | 62 | */ |
63 | 63 |
|
64 | | -#if defined(OPENNURBS_EXPORTS) |
65 | | -// OPENNURBS_EXPORTS is Microsoft's prefered defined for building an opennurbs DLL. |
66 | | -#if !defined(ON_DLL_EXPORTS) |
67 | | -#define ON_DLL_EXPORTS |
68 | | -#endif |
69 | | -#if !defined(ON_COMPILING_OPENNURBS) |
70 | | -#define ON_COMPILING_OPENNURBS |
71 | | -#endif |
72 | | -#endif |
73 | | - |
74 | | -#if defined(OPENNURBS_IMPORTS) |
75 | | -// OPENNURBS_EXPORTS is Microsoft's prefered defined for linking with an opennurbs DLL. |
76 | | -#if !defined(ON_DLL_IMPORTS) |
77 | | -#define ON_DLL_IMPORTS |
78 | | -#endif |
79 | | -#endif |
80 | | - |
81 | | -#if defined(ON_DLL_EXPORTS) && defined(ON_DLL_IMPORTS) |
82 | | -#error At most one of ON_DLL_EXPORTS and ON_DLL_IMPORTS can be defined. |
83 | | -#endif |
| 64 | +#ifdef PCL_STATIC_DEFINE |
84 | 65 |
|
85 | | -/* export/import */ |
86 | | -#if defined(ON_DLL_EXPORTS) |
| 66 | +/* compiling or using OpenNurbs as a static library */ |
| 67 | +#define ON_CLASS |
| 68 | +#define ON_DECL |
| 69 | +#define ON_EXTERN_DECL |
87 | 70 |
|
88 | | -#if !defined(ON_COMPILING_OPENNURBS) |
89 | | -#error When compiling an OpenNURBS DLL, ON_DLL_EXPORTS must be defined |
| 71 | +#if defined(ON_DLL_TEMPLATE) |
| 72 | +#undef ON_DLL_TEMPLATE |
90 | 73 | #endif |
91 | 74 |
|
92 | | -/* compiling OpenNurbs as a Windows DLL - export classes, functions, templates, and globals */ |
| 75 | +#else |
| 76 | +#if defined WIN32 || defined _WIN32 || defined WINCE || defined __MINGW32__ |
| 77 | +#ifdef OPENNURBS_EXPORTS |
| 78 | +/* compiling OpenNurbs as a Windows DLL - export classes, functions, templates, and |
| 79 | + * globals */ |
93 | 80 | #define ON_CLASS __declspec(dllexport) |
94 | 81 | #define ON_DECL __declspec(dllexport) |
95 | 82 | #define ON_EXTERN_DECL __declspec(dllexport) |
96 | 83 | #define ON_DLL_TEMPLATE |
97 | | - |
98 | | -#elif defined(ON_DLL_IMPORTS) |
99 | | - |
100 | | -#if defined(ON_COMPILING_OPENNURBS) |
101 | | -#error When compiling an OpenNURBS DLL, ON_DLL_IMPORTS must NOT be defined |
102 | | -#endif |
103 | | - |
104 | | -/* using OpenNurbs as a Windows DLL - import classes, functions, templates, and globals */ |
| 84 | +#define ON_DLL_EXPORTS |
| 85 | +#else |
| 86 | +/* using OpenNurbs as a Windows DLL - import classes, functions, templates, and globals |
| 87 | + */ |
105 | 88 | #define ON_CLASS __declspec(dllimport) |
106 | 89 | #define ON_DECL __declspec(dllimport) |
107 | 90 | #define ON_EXTERN_DECL __declspec(dllimport) |
108 | 91 | #define ON_DLL_TEMPLATE extern |
109 | | - |
| 92 | +#define ON_DLL_IMPORTS |
| 93 | +#endif |
| 94 | +#else |
| 95 | +#ifdef PCL_SYMBOL_VISIBILITY_HIDDEN |
| 96 | +#define ON_CLASS __attribute__((visibility("default"))) |
| 97 | +#define ON_DECL __attribute__((visibility("default"))) |
| 98 | +#define ON_EXTERN_DECL __attribute__((visibility("default"))) |
| 99 | +#define ON_DLL_TEMPLATE |
| 100 | +#define ON_DLL_EXPORTS |
110 | 101 | #else |
111 | | - |
112 | | -/* compiling or using OpenNurbs as a static library */ |
113 | 102 | #define ON_CLASS |
114 | 103 | #define ON_DECL |
115 | 104 | #define ON_EXTERN_DECL |
116 | | - |
117 | | -#if defined(ON_DLL_TEMPLATE) |
118 | | -#undef ON_DLL_TEMPLATE |
| 105 | +#define ON_DLL_TEMPLATE |
| 106 | +#define ON_DLL_EXPORTS |
| 107 | +#endif |
119 | 108 | #endif |
120 | | - |
121 | 109 | #endif |
122 | 110 |
|
123 | 111 |
|
|
0 commit comments