Move dllexport to platformdefines.h.
authorAditya Mandaleeka <adityam@microsoft.com>
Thu, 31 Mar 2016 00:04:53 +0000 (17:04 -0700)
committerAditya Mandaleeka <adityam@microsoft.com>
Thu, 31 Mar 2016 00:04:53 +0000 (17:04 -0700)
tests/src/Common/Platform/platformdefines.h
tests/src/Exceptions/ForeignThread/ForeignThreadExceptionsNative.cpp

index 7853a3b7c7981bc3baa417fffa021fa20238cfc3..69561a04358ce27e514394a3a74ed776051ac07e 100644 (file)
@@ -24,6 +24,8 @@
 typedef unsigned error_t;
 typedef HANDLE THREAD_ID;
 
+#define DLL_EXPORT __declspec(dllexport)
+
 #else // !WINDOWS
 #include <pthread.h>
 
@@ -52,6 +54,12 @@ typedef const WCHAR *LPCWSTR, *PCWSTR;
 #endif
 #endif
 
+#if __GNUC__ >= 4
+#define DLL_EXPORT __attribute__ ((visibility ("default")))
+#else
+#define DLL_EXPORT
+#endif
+
 LPWSTR HackyConvertToWSTR(char* pszInput);
 
 #define FS_SEPERATOR L("/")
index 2d237b8a2780434cd2eb1ebc0f43bf731faec7e1..b6405975a9184e9cf1704d744582600231c9815a 100644 (file)
@@ -9,16 +9,11 @@
  #include <thread>
 #pragma warning(pop)
 
-
-#if defined _WIN32
-  #define DLL_EXPORT __declspec(dllexport)
-#else
-  #if __GNUC__ >= 4
-    #define DLL_EXPORT __attribute__ ((visibility ("default")))
-  #else
-    #define DLL_EXPORT
-  #endif
-#endif //_WIN32
+// Work around typedef redefinition: platformdefines.h defines error_t
+// as unsigned while it's defined as int in errno.h.
+#define error_t error_t_ignore
+#include "platformdefines.h"
+#undef error_t
 
 typedef void (*PFNACTION1)();