Browse Source

Shared library should export symbols on windows

Andy Cedilnik 23 years ago
parent
commit
fe6721af84
2 changed files with 13 additions and 1 deletions
  1. 2 0
      Tests/COnly/libc2.c
  2. 11 1
      Tests/COnly/libc2.h

+ 2 - 0
Tests/COnly/libc2.c

@@ -1,3 +1,5 @@
+#include "libc2.h"
+
 float LibC2Func()
 {
   return 1.0;

+ 11 - 1
Tests/COnly/libc2.h

@@ -1 +1,11 @@
-extern float LibC2Func();
+#ifdef _WIN32
+#  ifdef c2_EXPORTS
+#    define CM_TEST_LIB_EXPORT  __declspec( dllexport )
+#  else
+#    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
+#  endif
+#else
+#  define CM_TEST_LIB_EXPORT 
+#endif
+
+CM_TEST_LIB_EXPORT float LibC2Func();