|
1 | | - |
2 | 1 | #ifndef OB_EXPORT_H |
3 | 2 | #define OB_EXPORT_H |
4 | 3 |
|
5 | 4 | #ifdef OB_STATIC_DEFINE |
6 | | -# define OB_EXPORT |
7 | | -# define OB_NO_EXPORT |
| 5 | +#define OB_EXPORT |
| 6 | +#define OB_NO_EXPORT |
| 7 | +#else |
| 8 | +#ifdef _WIN32 |
| 9 | +/* Windows platform */ |
| 10 | +#ifndef OB_EXPORT |
| 11 | +#ifdef OrbbecSDK_EXPORTS |
| 12 | +/* We are building this library */ |
| 13 | +#define OB_EXPORT __declspec(dllexport) |
8 | 14 | #else |
9 | | -# ifndef OB_EXPORT |
10 | | -# ifdef OrbbecSDK_EXPORTS |
11 | | - /* We are building this library */ |
12 | | -# define OB_EXPORT __attribute__((visibility("default"))) |
13 | | -# else |
14 | | - /* We are using this library */ |
15 | | -# define OB_EXPORT __attribute__((visibility("default"))) |
16 | | -# endif |
17 | | -# endif |
| 15 | +/* We are using this library */ |
| 16 | +#define OB_EXPORT __declspec(dllimport) |
| 17 | +#endif |
| 18 | +#endif |
18 | 19 |
|
19 | | -# ifndef OB_NO_EXPORT |
20 | | -# define OB_NO_EXPORT __attribute__((visibility("hidden"))) |
21 | | -# endif |
| 20 | +#ifndef OB_NO_EXPORT |
| 21 | +#define OB_NO_EXPORT |
| 22 | +#endif |
| 23 | +#else |
| 24 | +/* Unix-like platforms (Linux, macOS, etc.) */ |
| 25 | +#ifndef OB_EXPORT |
| 26 | +#ifdef OrbbecSDK_EXPORTS |
| 27 | +/* We are building this library */ |
| 28 | +#define OB_EXPORT __attribute__((visibility("default"))) |
| 29 | +#else |
| 30 | +/* We are using this library */ |
| 31 | +#define OB_EXPORT __attribute__((visibility("default"))) |
| 32 | +#endif |
| 33 | +#endif |
| 34 | + |
| 35 | +#ifndef OB_NO_EXPORT |
| 36 | +#define OB_NO_EXPORT __attribute__((visibility("hidden"))) |
| 37 | +#endif |
| 38 | +#endif |
22 | 39 | #endif |
23 | 40 |
|
24 | 41 | #ifndef OB_DEPRECATED |
25 | | -# define OB_DEPRECATED __attribute__ ((__deprecated__)) |
| 42 | +#ifdef _WIN32 |
| 43 | +#define OB_DEPRECATED __declspec(deprecated) |
| 44 | +#else |
| 45 | +#define OB_DEPRECATED __attribute__((__deprecated__)) |
| 46 | +#endif |
26 | 47 | #endif |
27 | 48 |
|
28 | 49 | #ifndef OB_DEPRECATED_EXPORT |
29 | | -# define OB_DEPRECATED_EXPORT OB_EXPORT OB_DEPRECATED |
| 50 | +#define OB_DEPRECATED_EXPORT OB_EXPORT OB_DEPRECATED |
30 | 51 | #endif |
31 | 52 |
|
32 | 53 | #ifndef OB_DEPRECATED_NO_EXPORT |
33 | | -# define OB_DEPRECATED_NO_EXPORT OB_NO_EXPORT OB_DEPRECATED |
| 54 | +#define OB_DEPRECATED_NO_EXPORT OB_NO_EXPORT OB_DEPRECATED |
34 | 55 | #endif |
35 | 56 |
|
36 | 57 | /* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */ |
37 | 58 | #if 0 /* DEFINE_NO_DEPRECATED */ |
38 | | -# ifndef OB_NO_DEPRECATED |
39 | | -# define OB_NO_DEPRECATED |
40 | | -# endif |
| 59 | +#ifndef OB_NO_DEPRECATED |
| 60 | +#define OB_NO_DEPRECATED |
| 61 | +#endif |
41 | 62 | #endif |
42 | 63 |
|
43 | 64 | #endif /* OB_EXPORT_H */ |
0 commit comments