diff options
author | Adeel Mujahid <adeelbm@outlook.com> | 2019-02-09 03:24:59 +0200 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2019-02-09 02:24:59 +0100 |
commit | 5bb7eb68035e98e356aba68115e28ed22d3d34aa (patch) | |
tree | 6a2ce545da5c8c32591910ffcb2fe86186894c22 /src/pal/src | |
parent | 8e79024b436f348ea9f96487a6d54067e750f596 (diff) | |
download | coreclr-5bb7eb68035e98e356aba68115e28ed22d3d34aa.tar.gz coreclr-5bb7eb68035e98e356aba68115e28ed22d3d34aa.tar.bz2 coreclr-5bb7eb68035e98e356aba68115e28ed22d3d34aa.zip |
Set visibility option to hidden (#21924)
Diffstat (limited to 'src/pal/src')
-rw-r--r-- | src/pal/src/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/pal/src/cruntime/misc.cpp | 4 | ||||
-rw-r--r-- | src/pal/src/include/pal/module.h | 6 | ||||
-rw-r--r-- | src/pal/src/locale/unicode_data.cpp | 6 | ||||
-rw-r--r-- | src/pal/src/misc/environ.cpp | 3 | ||||
-rw-r--r-- | src/pal/src/safecrt/mbusafecrt_internal.h | 8 | ||||
-rw-r--r-- | src/pal/src/safecrt/memcpy_s.cpp | 2 | ||||
-rw-r--r-- | src/pal/src/safecrt/sprintf_s.cpp | 5 | ||||
-rw-r--r-- | src/pal/src/safecrt/sscanf_s.cpp | 2 | ||||
-rw-r--r-- | src/pal/src/safecrt/swprintf.cpp | 4 | ||||
-rw-r--r-- | src/pal/src/safecrt/vsprintf.cpp | 4 | ||||
-rw-r--r-- | src/pal/src/safecrt/vswprint.cpp | 4 | ||||
-rw-r--r-- | src/pal/src/safecrt/xtoa_s.cpp | 2 | ||||
-rw-r--r-- | src/pal/src/safecrt/xtox_s.inl | 4 |
14 files changed, 43 insertions, 27 deletions
diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt index be5b5bd872..829638b693 100644 --- a/src/pal/src/CMakeLists.txt +++ b/src/pal/src/CMakeLists.txt @@ -295,10 +295,18 @@ add_library(coreclrpal ${LIBUNWIND_OBJECTS} ) -add_library(tracepointprovider - STATIC - misc/tracepointprovider.cpp -) +# There is only one function exported in 'tracepointprovider.cpp' namely 'PAL_InitializeTracing', +# which is guarded with '#if defined(__linux__)'. On macOS, Xcode issues the following warning: +# +# > warning: /Applications/Xcode-9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: +# > warning for library: libtracepointprovider.a the table of contents is empty (no object file members in the library define global symbols) +# +if(CMAKE_SYSTEM_NAME STREQUAL Linux) + add_library(tracepointprovider + STATIC + misc/tracepointprovider.cpp + ) +endif(CMAKE_SYSTEM_NAME STREQUAL Linux) if(CMAKE_SYSTEM_NAME STREQUAL Darwin) find_library(COREFOUNDATION CoreFoundation) diff --git a/src/pal/src/cruntime/misc.cpp b/src/pal/src/cruntime/misc.cpp index 9e5acf65ff..68427f52c9 100644 --- a/src/pal/src/cruntime/misc.cpp +++ b/src/pal/src/cruntime/misc.cpp @@ -138,7 +138,6 @@ Function: See MSDN for more details. --*/ - PAL_time_t __cdecl PAL_mktime(struct PAL_tm *tm) @@ -215,7 +214,6 @@ PAL_time(PAL_time_t *tloc) return result; } - PALIMPORT void __cdecl PAL_qsort(void *base, size_t nmemb, size_t size, @@ -245,6 +243,7 @@ PAL_qsort(void *base, size_t nmemb, size_t size, PERF_EXIT(qsort); } +DLLEXPORT PALIMPORT void * __cdecl PAL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, @@ -300,6 +299,7 @@ PAL_memcpy Overlapping buffer-safe version of memcpy. See MSDN doc for memcpy --*/ +DLLEXPORT EXTERN_C PALIMPORT void *PAL_memcpy (void *dest, const void *src, size_t count) diff --git a/src/pal/src/include/pal/module.h b/src/pal/src/include/pal/module.h index aacc326c64..66ac23834a 100644 --- a/src/pal/src/include/pal/module.h +++ b/src/pal/src/include/pal/module.h @@ -25,9 +25,9 @@ extern "C" { #endif // __cplusplus -typedef BOOL (PALAPI *PDLLMAIN)(HINSTANCE, DWORD, LPVOID); /* entry point of module */ -typedef HINSTANCE (PALAPI *PREGISTER_MODULE)(LPCSTR); /* used to create the HINSTANCE for above DLLMain entry point */ -typedef VOID (PALAPI *PUNREGISTER_MODULE)(HINSTANCE); /* used to cleanup the HINSTANCE for above DLLMain entry point */ +typedef BOOL (PALAPI_NOEXPORT *PDLLMAIN)(HINSTANCE, DWORD, LPVOID); /* entry point of module */ +typedef HINSTANCE (PALAPI_NOEXPORT *PREGISTER_MODULE)(LPCSTR); /* used to create the HINSTANCE for above DLLMain entry point */ +typedef VOID (PALAPI_NOEXPORT *PUNREGISTER_MODULE)(HINSTANCE); /* used to cleanup the HINSTANCE for above DLLMain entry point */ typedef struct _MODSTRUCT { diff --git a/src/pal/src/locale/unicode_data.cpp b/src/pal/src/locale/unicode_data.cpp index f9ba166f11..4f7a51fc90 100644 --- a/src/pal/src/locale/unicode_data.cpp +++ b/src/pal/src/locale/unicode_data.cpp @@ -22,7 +22,7 @@ Abstract: #if !HAVE_COREFOUNDATION -CONST UnicodeDataRec UnicodeData[] = { +CONST UnicodeDataRec UnicodeData[] DLLEXPORT = { { 0x0000, 0x0020, 0x0000, 0 }, @@ -1846,7 +1846,7 @@ CONST UnicodeDataRec UnicodeData[] = { { 0xffe0, 0x0010, 0x0000, 13 }, }; -CONST UINT UNICODE_DATA_SIZE = sizeof(UnicodeData)/sizeof(UnicodeDataRec); -CONST UINT UNICODE_DATA_DIRECT_ACCESS = 256; +CONST UINT UNICODE_DATA_SIZE DLLEXPORT = sizeof(UnicodeData)/sizeof(UnicodeDataRec); +CONST UINT UNICODE_DATA_DIRECT_ACCESS DLLEXPORT = 256; #endif // !HAVE_COREFOUNDATION diff --git a/src/pal/src/misc/environ.cpp b/src/pal/src/misc/environ.cpp index 9fc13467c5..f73d7ec71f 100644 --- a/src/pal/src/misc/environ.cpp +++ b/src/pal/src/misc/environ.cpp @@ -1050,6 +1050,7 @@ See MSDN for more details. Note: The BSD implementation can cause memory leaks. See man pages for more details. --*/ +DLLEXPORT int __cdecl _putenv( const char * envstring ) @@ -1079,7 +1080,7 @@ Function : PAL_getenv See MSDN for more details. --*/ -char * __cdecl PAL_getenv(const char *varname) +DLLEXPORT char * __cdecl PAL_getenv(const char *varname) { char *retval; diff --git a/src/pal/src/safecrt/mbusafecrt_internal.h b/src/pal/src/safecrt/mbusafecrt_internal.h index 9a3aa1ca90..973c8695bf 100644 --- a/src/pal/src/safecrt/mbusafecrt_internal.h +++ b/src/pal/src/safecrt/mbusafecrt_internal.h @@ -21,6 +21,14 @@ #include "pal_char16.h" #include "pal_mstypes.h" +#ifndef DLLEXPORT +#ifdef _MSC_VER +#define DLLEXPORT __declspec(dllexport) +#else +#define DLLEXPORT __attribute__ ((visibility ("default"))) +#endif // _MSC_VER +#endif // !DLLEXPORT + typedef __builtin_va_list va_list; // The ifdef below are to accommodate Unix build diff --git a/src/pal/src/safecrt/memcpy_s.cpp b/src/pal/src/safecrt/memcpy_s.cpp index a75ec41861..db3bb5f1fc 100644 --- a/src/pal/src/safecrt/memcpy_s.cpp +++ b/src/pal/src/safecrt/memcpy_s.cpp @@ -49,7 +49,7 @@ * *******************************************************************************/ -errno_t __cdecl memcpy_s( +DLLEXPORT errno_t __cdecl memcpy_s( void * dst, size_t sizeInBytes, const void * src, diff --git a/src/pal/src/safecrt/sprintf_s.cpp b/src/pal/src/safecrt/sprintf_s.cpp index edfb768670..79a4e4345b 100644 --- a/src/pal/src/safecrt/sprintf_s.cpp +++ b/src/pal/src/safecrt/sprintf_s.cpp @@ -65,8 +65,7 @@ *Exceptions: * *******************************************************************************/ - -int sprintf_s ( +DLLEXPORT int sprintf_s ( char *string, size_t sizeInBytes, const char *format, @@ -81,7 +80,7 @@ int sprintf_s ( return ret; } -int _snprintf_s ( +DLLEXPORT int _snprintf_s ( char *string, size_t sizeInBytes, size_t count, diff --git a/src/pal/src/safecrt/sscanf_s.cpp b/src/pal/src/safecrt/sscanf_s.cpp index 7a481b580f..686513d3df 100644 --- a/src/pal/src/safecrt/sscanf_s.cpp +++ b/src/pal/src/safecrt/sscanf_s.cpp @@ -189,7 +189,7 @@ static int __cdecl vnwscan_fn ( * *******************************************************************************/ -int __cdecl sscanf_s ( +DLLEXPORT int __cdecl sscanf_s ( const char *string, const char *format, ... diff --git a/src/pal/src/safecrt/swprintf.cpp b/src/pal/src/safecrt/swprintf.cpp index 2fbfcfaf58..1d8cf420b0 100644 --- a/src/pal/src/safecrt/swprintf.cpp +++ b/src/pal/src/safecrt/swprintf.cpp @@ -80,7 +80,7 @@ * *******************************************************************************/ -int __cdecl swprintf_s ( +DLLEXPORT int __cdecl swprintf_s ( wchar_t *string, size_t sizeInWords, const wchar_t *format, @@ -99,7 +99,7 @@ int __cdecl swprintf_s ( return ret; } -int __cdecl _snwprintf_s ( +DLLEXPORT int __cdecl _snwprintf_s ( wchar_t *string, size_t sizeInWords, size_t count, diff --git a/src/pal/src/safecrt/vsprintf.cpp b/src/pal/src/safecrt/vsprintf.cpp index e1a94d086d..6d4b786984 100644 --- a/src/pal/src/safecrt/vsprintf.cpp +++ b/src/pal/src/safecrt/vsprintf.cpp @@ -119,7 +119,7 @@ int __cdecl _vsnprintf_helper ( return -1; } -int __cdecl vsprintf_s ( +DLLEXPORT int __cdecl vsprintf_s ( char *string, size_t sizeInBytes, const char *format, @@ -150,7 +150,7 @@ int __cdecl vsprintf_s ( return retvalue; } -int __cdecl _vsnprintf_s ( +DLLEXPORT int __cdecl _vsnprintf_s ( char *string, size_t sizeInBytes, size_t count, diff --git a/src/pal/src/safecrt/vswprint.cpp b/src/pal/src/safecrt/vswprint.cpp index b9940a693a..3f814120f1 100644 --- a/src/pal/src/safecrt/vswprint.cpp +++ b/src/pal/src/safecrt/vswprint.cpp @@ -112,7 +112,7 @@ int __cdecl _vswprintf_helper ( return -1; } -int __cdecl vswprintf_s ( +DLLEXPORT int __cdecl vswprintf_s ( wchar_t *string, size_t sizeInWords, const wchar_t *format, @@ -143,7 +143,7 @@ int __cdecl vswprintf_s ( return retvalue; } -int __cdecl _vsnwprintf_s ( +DLLEXPORT int __cdecl _vsnwprintf_s ( wchar_t *string, size_t sizeInWords, size_t count, diff --git a/src/pal/src/safecrt/xtoa_s.cpp b/src/pal/src/safecrt/xtoa_s.cpp index 42cc5786d1..2857beab07 100644 --- a/src/pal/src/safecrt/xtoa_s.cpp +++ b/src/pal/src/safecrt/xtoa_s.cpp @@ -12,7 +12,7 @@ * via repeated calls. * *******************************************************************************/ - +#include "pal/palinternal.h" #include <string.h> #include <errno.h> #include <limits.h> diff --git a/src/pal/src/safecrt/xtox_s.inl b/src/pal/src/safecrt/xtox_s.inl index 7c8b2f2fd6..2ad59e5825 100644 --- a/src/pal/src/safecrt/xtox_s.inl +++ b/src/pal/src/safecrt/xtox_s.inl @@ -154,7 +154,7 @@ static void __stdcall xtox and return pointer to buffer. */ #ifdef _SECURE_ITOA -errno_t __cdecl _itox_s ( +DLLEXPORT errno_t __cdecl _itox_s ( int val, TCHAR *buf, size_t sizeInTChars, @@ -359,7 +359,7 @@ static void __fastcall x64tox /* Actual functions just call conversion helper with neg flag set correctly, and return pointer to buffer. */ -errno_t __cdecl _i64tox_s ( +DLLEXPORT errno_t __cdecl _i64tox_s ( long long val, TCHAR *buf, size_t sizeInTChars, |