From d569cc146ed16585fb039e543e93bb1d4fcb47af Mon Sep 17 00:00:00 2001 From: Aditya Mandaleeka Date: Wed, 30 Mar 2016 17:04:53 -0700 Subject: [PATCH] Move dllexport to platformdefines.h. Commit migrated from https://github.com/dotnet/coreclr/commit/064744a23663cb0a34c6364618c3be308ee87933 --- src/coreclr/tests/src/Common/Platform/platformdefines.h | 8 ++++++++ .../ForeignThread/ForeignThreadExceptionsNative.cpp | 15 +++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/coreclr/tests/src/Common/Platform/platformdefines.h b/src/coreclr/tests/src/Common/Platform/platformdefines.h index 7853a3b..69561a0 100644 --- a/src/coreclr/tests/src/Common/Platform/platformdefines.h +++ b/src/coreclr/tests/src/Common/Platform/platformdefines.h @@ -24,6 +24,8 @@ typedef unsigned error_t; typedef HANDLE THREAD_ID; +#define DLL_EXPORT __declspec(dllexport) + #else // !WINDOWS #include @@ -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("/") diff --git a/src/coreclr/tests/src/Exceptions/ForeignThread/ForeignThreadExceptionsNative.cpp b/src/coreclr/tests/src/Exceptions/ForeignThread/ForeignThreadExceptionsNative.cpp index 2d237b8..b640597 100644 --- a/src/coreclr/tests/src/Exceptions/ForeignThread/ForeignThreadExceptionsNative.cpp +++ b/src/coreclr/tests/src/Exceptions/ForeignThread/ForeignThreadExceptionsNative.cpp @@ -9,16 +9,11 @@ #include #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)(); -- 2.7.4