From 7fe9b6ef08808932dae91037079cf2d2ca988b26 Mon Sep 17 00:00:00 2001 From: Joe Dong Date: Mon, 2 Dec 2024 16:37:45 +0800 Subject: [PATCH] drop back export.h --- sdk/include/libobsensor/h/Export.h | 63 ++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/sdk/include/libobsensor/h/Export.h b/sdk/include/libobsensor/h/Export.h index a8fb41f..03f0098 100644 --- a/sdk/include/libobsensor/h/Export.h +++ b/sdk/include/libobsensor/h/Export.h @@ -1,43 +1,64 @@ - #ifndef OB_EXPORT_H #define OB_EXPORT_H #ifdef OB_STATIC_DEFINE -# define OB_EXPORT -# define OB_NO_EXPORT +#define OB_EXPORT +#define OB_NO_EXPORT +#else +#ifdef _WIN32 +/* Windows platform */ +#ifndef OB_EXPORT +#ifdef OrbbecSDK_EXPORTS +/* We are building this library */ +#define OB_EXPORT __declspec(dllexport) #else -# ifndef OB_EXPORT -# ifdef OrbbecSDK_EXPORTS - /* We are building this library */ -# define OB_EXPORT __attribute__((visibility("default"))) -# else - /* We are using this library */ -# define OB_EXPORT __attribute__((visibility("default"))) -# endif -# endif +/* We are using this library */ +#define OB_EXPORT __declspec(dllimport) +#endif +#endif -# ifndef OB_NO_EXPORT -# define OB_NO_EXPORT __attribute__((visibility("hidden"))) -# endif +#ifndef OB_NO_EXPORT +#define OB_NO_EXPORT +#endif +#else +/* Unix-like platforms (Linux, macOS, etc.) */ +#ifndef OB_EXPORT +#ifdef OrbbecSDK_EXPORTS +/* We are building this library */ +#define OB_EXPORT __attribute__((visibility("default"))) +#else +/* We are using this library */ +#define OB_EXPORT __attribute__((visibility("default"))) +#endif +#endif + +#ifndef OB_NO_EXPORT +#define OB_NO_EXPORT __attribute__((visibility("hidden"))) +#endif +#endif #endif #ifndef OB_DEPRECATED -# define OB_DEPRECATED __attribute__ ((__deprecated__)) +#ifdef _WIN32 +#define OB_DEPRECATED __declspec(deprecated) +#else +#define OB_DEPRECATED __attribute__((__deprecated__)) +#endif #endif #ifndef OB_DEPRECATED_EXPORT -# define OB_DEPRECATED_EXPORT OB_EXPORT OB_DEPRECATED +#define OB_DEPRECATED_EXPORT OB_EXPORT OB_DEPRECATED #endif #ifndef OB_DEPRECATED_NO_EXPORT -# define OB_DEPRECATED_NO_EXPORT OB_NO_EXPORT OB_DEPRECATED +#define OB_DEPRECATED_NO_EXPORT OB_NO_EXPORT OB_DEPRECATED #endif /* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */ #if 0 /* DEFINE_NO_DEPRECATED */ -# ifndef OB_NO_DEPRECATED -# define OB_NO_DEPRECATED -# endif +#ifndef OB_NO_DEPRECATED +#define OB_NO_DEPRECATED +#endif #endif #endif /* OB_EXPORT_H */