aboutsummaryrefslogtreecommitdiffstats
path: root/host/include/uhd/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'host/include/uhd/config.h')
-rw-r--r--host/include/uhd/config.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/host/include/uhd/config.h b/host/include/uhd/config.h
index c7184ea4d..a6c05f0c4 100644
--- a/host/include/uhd/config.h
+++ b/host/include/uhd/config.h
@@ -24,6 +24,8 @@ typedef SSIZE_T ssize_t;
#if defined(_MSC_VER)
#define UHD_EXPORT __declspec(dllexport)
#define UHD_IMPORT __declspec(dllimport)
+ #define UHD_EXPORT_HEADER
+ #define UHD_IMPORT_HEADER
#define UHD_INLINE __forceinline
#define UHD_DEPRECATED __declspec(deprecated)
#define UHD_ALIGNED(x) __declspec(align(x))
@@ -31,6 +33,8 @@ typedef SSIZE_T ssize_t;
#elif defined(__MINGW32__)
#define UHD_EXPORT __declspec(dllexport)
#define UHD_IMPORT __declspec(dllimport)
+ #define UHD_EXPORT_HEADER
+ #define UHD_IMPORT_HEADER
#define UHD_INLINE inline
#define UHD_DEPRECATED __declspec(deprecated)
#define UHD_ALIGNED(x) __declspec(align(x))
@@ -38,6 +42,8 @@ typedef SSIZE_T ssize_t;
#elif defined(__GNUC__) && __GNUC__ >= 4
#define UHD_EXPORT __attribute__((visibility("default")))
#define UHD_IMPORT __attribute__((visibility("default")))
+ #define UHD_EXPORT_HEADER __attribute__((visibility("default")))
+ #define UHD_IMPORT_HEADER __attribute__((visibility("default")))
#define UHD_INLINE inline __attribute__((always_inline))
#define UHD_DEPRECATED __attribute__((deprecated))
#define UHD_ALIGNED(x) __attribute__((aligned(x)))
@@ -45,6 +51,8 @@ typedef SSIZE_T ssize_t;
#elif defined(__clang__)
#define UHD_EXPORT __attribute__((visibility("default")))
#define UHD_IMPORT __attribute__((visibility("default")))
+ #define UHD_EXPORT_HEADER __attribute__((visibility("default")))
+ #define UHD_IMPORT_HEADER __attribute__((visibility("default")))
#define UHD_INLINE inline __attribute__((always_inline))
#define UHD_DEPRECATED __attribute__((deprecated))
#define UHD_ALIGNED(x) __attribute__((aligned(x)))
@@ -52,22 +60,32 @@ typedef SSIZE_T ssize_t;
#else
#define UHD_EXPORT
#define UHD_IMPORT
+ #define UHD_EXPORT_HEADER
+ #define UHD_IMPORT_HEADER
#define UHD_INLINE inline
#define UHD_DEPRECATED
#define UHD_ALIGNED(x)
#define UHD_UNUSED(x) x
#endif
-// API declaration macro
-
// Define API declaration macro
+//
+// UHD_API should be used for classes/structs that
+// have a direct cpp implementations that get directly
+// built into a so/dylib/dll.
+//
+// UHD_API_HEADER should be used for classes/structs
+// that are implemented in header only like hpp/ipp.
#ifdef UHD_STATIC_LIB
#define UHD_API
+ #define UHD_API_HEADER
#else
#ifdef UHD_DLL_EXPORTS
#define UHD_API UHD_EXPORT
+ #define UHD_API_HEADER UHD_EXPORT_HEADER
#else
#define UHD_API UHD_IMPORT
+ #define UHD_API_HEADER UHD_IMPORT_HEADER
#endif // UHD_DLL_EXPORTS
#endif // UHD_STATIC_LIB