|
3 | 3 |
|
4 | 4 | #pragma once |
5 | 5 |
|
| 6 | +// For an explanation of how these export defines work, see: |
| 7 | +// https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/base/arch/export.h |
6 | 8 | #if defined(_WINDOWS) |
7 | 9 | # if defined(__GNUC__) && __GNUC__ >= 4 || defined(__clang__) |
8 | | -# define ARCH_EXPORT __attribute__((dllexport)) |
9 | | -# define ARCH_IMPORT __attribute__((dllimport)) |
10 | | -# define ARCH_HIDDEN |
11 | | -# define ARCH_EXPORT_TYPE |
| 10 | +# define OPENTIMELINIO_EXPORT __attribute__((dllexport)) |
| 11 | +# define OPENTIMELINIO_IMPORT __attribute__((dllimport)) |
| 12 | +# define OPENTIMELINIO_HIDDEN |
| 13 | +# define OPENTIMELINIO_EXPORT_TYPE |
12 | 14 | # else |
13 | | -# define ARCH_EXPORT __declspec(dllexport) |
14 | | -# define ARCH_IMPORT __declspec(dllimport) |
15 | | -# define ARCH_HIDDEN |
16 | | -# define ARCH_EXPORT_TYPE |
| 15 | +# define OPENTIMELINIO_EXPORT __declspec(dllexport) |
| 16 | +# define OPENTIMELINIO_IMPORT __declspec(dllimport) |
| 17 | +# define OPENTIMELINIO_HIDDEN |
| 18 | +# define OPENTIMELINIO_EXPORT_TYPE |
17 | 19 | # endif |
18 | 20 | #elif defined(__GNUC__) && __GNUC__ >= 4 || defined(__clang__) |
19 | | -# define ARCH_EXPORT __attribute__((visibility("default"))) |
20 | | -# define ARCH_IMPORT |
21 | | -# define ARCH_HIDDEN __attribute__((visibility("hidden"))) |
| 21 | +# define OPENTIMELINIO_EXPORT __attribute__((visibility("default"))) |
| 22 | +# define OPENTIMELINIO_IMPORT |
| 23 | +# define OPENTIMELINIO_HIDDEN __attribute__((visibility("hidden"))) |
22 | 24 | # if defined(__clang__) |
23 | | -# define ARCH_EXPORT_TYPE __attribute__((type_visibility("default"))) |
| 25 | +# define OPENTIMELINIO_EXPORT_TYPE __attribute__((type_visibility("default"))) |
24 | 26 | # else |
25 | | -# define ARCH_EXPORT_TYPE __attribute__((visibility("default"))) |
| 27 | +# define OPENTIMELINIO_EXPORT_TYPE __attribute__((visibility("default"))) |
26 | 28 | # endif |
27 | 29 | #else |
28 | | -# define ARCH_EXPORT |
29 | | -# define ARCH_IMPORT |
30 | | -# define ARCH_HIDDEN |
31 | | -# define ARCH_EXPORT_TYPE |
| 30 | +# define OPENTIMELINIO_EXPORT |
| 31 | +# define OPENTIMELINIO_IMPORT |
| 32 | +# define OPENTIMELINIO_HIDDEN |
| 33 | +# define OPENTIMELINIO_EXPORT_TYPE |
32 | 34 | #endif |
33 | | -#define ARCH_EXPORT_TEMPLATE(type, ...) |
34 | | -#define ARCH_IMPORT_TEMPLATE(type, ...) extern template type ARCH_IMPORT __VA_ARGS__ |
| 35 | +#define OPENTIMELINIO_EXPORT_TEMPLATE(type, ...) |
| 36 | +#define OPENTIMELINIO_IMPORT_TEMPLATE(type, ...) \ |
| 37 | + extern template type OPENTIMELINIO_IMPORT __VA_ARGS__ |
35 | 38 |
|
36 | 39 | #if defined(OPENTIME_STATIC) |
37 | 40 | # define OPENTIME_API |
|
41 | 44 | # define OPENTIME_LOCAL |
42 | 45 | #else |
43 | 46 | # if defined(OPENTIME_EXPORTS) |
44 | | -# define OPENTIME_API ARCH_EXPORT |
45 | | -# define OPENTIME_API_TYPE ARCH_EXPORT_TYPE |
46 | | -# define OPENTIME_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__) |
47 | | -# define OPENTIME_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__) |
| 47 | +# define OPENTIME_API OPENTIMELINIO_EXPORT |
| 48 | +# define OPENTIME_API_TYPE OPENTIMELINIO_EXPORT_TYPE |
| 49 | +# define OPENTIME_API_TEMPLATE_CLASS(...) \ |
| 50 | + OPENTIMELINIO_EXPORT_TEMPLATE(class, __VA_ARGS__) |
| 51 | +# define OPENTIME_API_TEMPLATE_STRUCT(...) \ |
| 52 | + OPENTIMELINIO_EXPORT_TEMPLATE(struct, __VA_ARGS__) |
48 | 53 | # else |
49 | | -# define OPENTIME_API ARCH_IMPORT |
50 | | -# define OPENTIME_API_TYPE ARCH_IMPORT_TYPE |
51 | | -# define OPENTIME_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__) |
52 | | -# define OPENTIME_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__) |
| 54 | +# define OPENTIME_API OPENTIMELINIO_IMPORT |
| 55 | +# define OPENTIME_API_TYPE OPENTIMELINIO_IMPORT_TYPE |
| 56 | +# define OPENTIME_API_TEMPLATE_CLASS(...) \ |
| 57 | + OPENTIMELINIO_IMPORT_TEMPLATE(class, __VA_ARGS__) |
| 58 | +# define OPENTIME_API_TEMPLATE_STRUCT(...) \ |
| 59 | + OPENTIMELINIO_IMPORT_TEMPLATE(struct, __VA_ARGS__) |
53 | 60 | # endif |
54 | | -# define OPENTIME_LOCAL ARCH_HIDDEN |
| 61 | +# define OPENTIME_LOCAL OPENTIMELINIO_HIDDEN |
55 | 62 | #endif |
0 commit comments