src/cx/common.h

changeset 1180
4c3a69b9723a
parent 1162
e3bb67b72d33
--- a/src/cx/common.h	Mon Feb 10 21:30:51 2025 +0100
+++ b/src/cx/common.h	Mon Feb 10 20:59:02 2025 +0100
@@ -266,6 +266,24 @@
 
 #endif // __STDC_VERSION__
 
+
+// ---------------------------------------------------------------------------
+//       MSVC specifics
+// ---------------------------------------------------------------------------
+
+#ifdef _MSC_VER
+// fix missing _Thread_local support
+#define _Thread_local __declspec(thread)
+#endif // _MSC_VER
+
+#if defined(CX_WINDLL_EXPORT)
+#define cx_attr_export __declspec(dllexport)
+#elif defined(CX_WINDLL)
+#define cx_attr_export __declspec(dllimport)
+#else
+#define cx_attr_export
+#endif // CX_WINDLL / CX_WINDLL_EXPORT
+
 // ---------------------------------------------------------------------------
 //       Useful function pointers
 // ---------------------------------------------------------------------------
@@ -340,17 +358,9 @@
 #if __cplusplus
 extern "C"
 #endif
-int cx_szmul_impl(size_t a, size_t b, size_t *result);
+cx_attr_export int cx_szmul_impl(size_t a, size_t b, size_t *result);
 #endif // cx_szmul
 
 
-// ---------------------------------------------------------------------------
-//       Fixes for MSVC incompatibilities
-// ---------------------------------------------------------------------------
-
-#ifdef _MSC_VER
-// fix missing _Thread_local support
-#define _Thread_local __declspec(thread)
-#endif // _MSC_VER
 
 #endif // UCX_COMMON_H

mercurial