Cleaned up what symbols are exported from the library.

This commit is contained in:
Ryan C. Gordon 2017-07-12 15:41:12 -04:00
parent 2cb1f73737
commit 19b15d34a1
4 changed files with 34 additions and 11 deletions

View File

@ -25,7 +25,7 @@ endif()
include_directories(./src) include_directories(./src)
if(APPLE) if(APPLE)
set(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-fno-common -framework CoreFoundation -framework IOKit") set(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework CoreFoundation -framework IOKit")
endif() endif()
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)

View File

@ -25,8 +25,8 @@
#define VDF_CRC16 0x8005 #define VDF_CRC16 0x8005
#define VDF_HASHTABLE_SIZE 65536 #define VDF_HASHTABLE_SIZE 65536
const char* VDF_SIGNATURE_G1 = "PSVDSC_V2.00\r\n\r\n"; static const char* VDF_SIGNATURE_G1 = "PSVDSC_V2.00\r\n\r\n";
const char* VDF_SIGNATURE_G2 = "PSVDSC_V2.00\n\r\n\r"; static const char* VDF_SIGNATURE_G2 = "PSVDSC_V2.00\n\r\n\r";
typedef union typedef union
{ {

View File

@ -1123,7 +1123,6 @@ static int doRegisterArchiver(const PHYSFS_Archiver *_archiver);
static int initStaticArchivers(void) static int initStaticArchivers(void)
{ {
#define REGISTER_STATIC_ARCHIVER(arc) { \ #define REGISTER_STATIC_ARCHIVER(arc) { \
extern const PHYSFS_Archiver __PHYSFS_Archiver_##arc; \
if (!doRegisterArchiver(&__PHYSFS_Archiver_##arc)) { \ if (!doRegisterArchiver(&__PHYSFS_Archiver_##arc)) { \
return 0; \ return 0; \
} \ } \

View File

@ -14,13 +14,6 @@
#error Do not include this header from your applications. #error Do not include this header from your applications.
#endif #endif
/* Make sure everything that includes this header exports no symbols by
default. physfs.h uses function attributes to mark only the public API as
visible. */
#if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
#pragma GCC visibility push(hidden)
#endif
/* Turn off MSVC warnings that are aggressively anti-portability. */ /* Turn off MSVC warnings that are aggressively anti-portability. */
#ifdef _MSC_VER #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS 1 #define _CRT_SECURE_NO_WARNINGS 1
@ -69,6 +62,33 @@ extern "C" {
#define _FILE_OFFSET_BITS 64 #define _FILE_OFFSET_BITS 64
#endif #endif
/* All public APIs need to be in physfs.h with a PHYSFS_DECL.
All file-private symbols need to be marked "static".
Everything shared between PhysicsFS sources needs to be in this
file between the visibility pragma blocks. */
#if PHYSFS_MINIMUM_GCC_VERSION(4,0) || defined(__clang__)
#define PHYSFS_HAVE_PRAGMA_VISIBILITY 1
#endif
#if PHYSFS_HAVE_PRAGMA_VISIBILITY
#pragma GCC visibility push(hidden)
#endif
/* These are the build-in archivers. We list them all as "extern" here without
#ifdefs to keep it tidy, but obviously you need to make sure these are
wrapped in PHYSFS_SUPPORTS_* checks before actually referencing them. */
extern const PHYSFS_Archiver __PHYSFS_Archiver_DIR;
extern const PHYSFS_Archiver __PHYSFS_Archiver_ZIP;
extern const PHYSFS_Archiver __PHYSFS_Archiver_LZMA;
extern const PHYSFS_Archiver __PHYSFS_Archiver_GRP;
extern const PHYSFS_Archiver __PHYSFS_Archiver_QPAK;
extern const PHYSFS_Archiver __PHYSFS_Archiver_HOG;
extern const PHYSFS_Archiver __PHYSFS_Archiver_MVL;
extern const PHYSFS_Archiver __PHYSFS_Archiver_WAD;
extern const PHYSFS_Archiver __PHYSFS_Archiver_SLB;
extern const PHYSFS_Archiver __PHYSFS_Archiver_ISO9660;
extern const PHYSFS_Archiver __PHYSFS_Archiver_VDF;
/* a real C99-compliant snprintf() is in Visual Studio 2015, /* a real C99-compliant snprintf() is in Visual Studio 2015,
but just use this everywhere for binary compatibility. */ but just use this everywhere for binary compatibility. */
#if defined(_MSC_VER) #if defined(_MSC_VER)
@ -655,6 +675,10 @@ int __PHYSFS_platformGrabMutex(void *mutex);
*/ */
void __PHYSFS_platformReleaseMutex(void *mutex); void __PHYSFS_platformReleaseMutex(void *mutex);
#if PHYSFS_HAVE_PRAGMA_VISIBILITY
#pragma GCC visibility pop
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif