Merge pull request #379 from libtom/private-symbols

enable MP_PRIVATE (visibility=hidden)
This commit is contained in:
Steffen Jaeckel 2019-10-19 15:34:13 +02:00 committed by GitHub
commit 0a3fa328c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -78,7 +78,7 @@ $(LIBMAIN_S): $(OBJECTS)
#Create DLL + import library libtommath.dll.a #Create DLL + import library libtommath.dll.a
$(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS)
$(CC) -s -shared -o $(LIBMAIN_D) $^ -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBMAIN_I) $(LTM_LDFLAGS) $(CC) -s -shared -o $(LIBMAIN_D) $^ tommath.def -Wl,--out-implib=$(LIBMAIN_I) $(LTM_LDFLAGS)
$(STRIP) -S $(LIBMAIN_D) $(STRIP) -S $(LIBMAIN_D)
#Build test suite #Build test suite

View File

@ -14,11 +14,9 @@
* *
* On Unix symbols can be marked as hidden if libtommath is compiled * On Unix symbols can be marked as hidden if libtommath is compiled
* as a shared object. By default, symbols are visible. * as a shared object. By default, symbols are visible.
* As of now, this feature is opt-in via the MP_PRIVATE_SYMBOLS define.
*
* On Win32 a .def file must be used to specify the exported symbols. * On Win32 a .def file must be used to specify the exported symbols.
*/ */
#if defined (MP_PRIVATE_SYMBOLS) && defined(__GNUC__) && __GNUC__ >= 4 #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(_WIN32)
# define MP_PRIVATE __attribute__ ((visibility ("hidden"))) # define MP_PRIVATE __attribute__ ((visibility ("hidden")))
#else #else
# define MP_PRIVATE # define MP_PRIVATE