Skip to content

Commit 7fe9b6e

Browse files
committed
drop back export.h
1 parent 52ebce8 commit 7fe9b6e

File tree

1 file changed

+42
-21
lines changed

1 file changed

+42
-21
lines changed

sdk/include/libobsensor/h/Export.h

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,64 @@
1-
21
#ifndef OB_EXPORT_H
32
#define OB_EXPORT_H
43

54
#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)
814
#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
1819

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
2239
#endif
2340

2441
#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
2647
#endif
2748

2849
#ifndef OB_DEPRECATED_EXPORT
29-
# define OB_DEPRECATED_EXPORT OB_EXPORT OB_DEPRECATED
50+
#define OB_DEPRECATED_EXPORT OB_EXPORT OB_DEPRECATED
3051
#endif
3152

3253
#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
3455
#endif
3556

3657
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
3758
#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
4162
#endif
4263

4364
#endif /* OB_EXPORT_H */

0 commit comments

Comments
 (0)