Add ID_GAME_API for dllexport/attribute(visibility)

Delete obsolete Game.def exports files
This commit is contained in:
spiral 2011-12-23 00:20:43 +00:00 committed by dhewg
parent d214a0f819
commit 1507a657d4
6 changed files with 27 additions and 20 deletions

View file

@ -138,9 +138,10 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_definitions(-fno-strict-aliasing) add_definitions(-fno-strict-aliasing)
CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" cxx_has_fvisibility) CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" cxx_has_fvisibility)
if (cxx_has_fvisibility) if (NOT cxx_has_fvisibility)
add_definitions(-fvisibility=hidden) message(FATAL_ERROR "Compiler does not support -fvisibility")
endif() endif()
add_definitions(-fvisibility=hidden)
# TODO fix these warnings # TODO fix these warnings
add_definitions(-Wno-sign-compare) add_definitions(-Wno-sign-compare)

View file

@ -1,2 +0,0 @@
EXPORTS
GetGameAPI

View file

@ -134,10 +134,7 @@ static const char* fastEntityList[] = {
GetGameAPI GetGameAPI
============ ============
*/ */
#if __GNUC__ >= 4 extern "C" ID_GAME_API gameExport_t *GetGameAPI( gameImport_t *import ) {
#pragma GCC visibility push(default)
#endif
extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) {
if ( import->version == GAME_API_VERSION ) { if ( import->version == GAME_API_VERSION ) {
@ -170,9 +167,6 @@ extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) {
return &gameExport; return &gameExport;
} }
#if __GNUC__ >= 4
#pragma GCC visibility pop
#endif
/* /*
=========== ===========

View file

@ -1 +0,0 @@
EXPORTS GetGameAPI

View file

@ -98,11 +98,7 @@ const char *idGameLocal::sufaceTypeNames[ MAX_SURFACE_TYPES ] = {
GetGameAPI GetGameAPI
============ ============
*/ */
#if __GNUC__ >= 4 extern "C" ID_GAME_API gameExport_t *GetGameAPI( gameImport_t *import ) {
#pragma GCC visibility push(default)
#endif
extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) {
if ( import->version == GAME_API_VERSION ) { if ( import->version == GAME_API_VERSION ) {
// set interface pointers used by the game // set interface pointers used by the game
@ -134,9 +130,6 @@ extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) {
return &gameExport; return &gameExport;
} }
#if __GNUC__ >= 4
#pragma GCC visibility pop
#endif
/* /*
=========== ===========

View file

@ -53,12 +53,22 @@ If you have questions concerning this license or the applicable additional terms
#define PATHSEPERATOR_CHAR '\\' #define PATHSEPERATOR_CHAR '\\'
#ifdef _MSC_VER #ifdef _MSC_VER
#ifdef GAME_DLL
#define ID_GAME_API __declspec(dllexport)
#else
#define ID_GAME_API
#endif
#define ALIGN16( x ) __declspec(align(16)) x #define ALIGN16( x ) __declspec(align(16)) x
#define PACKED #define PACKED
#define ID_INLINE __forceinline #define ID_INLINE __forceinline
#define ID_STATIC_TEMPLATE static #define ID_STATIC_TEMPLATE static
#define assertmem( x, y ) assert( _CrtIsValidPointer( x, y, true ) ) #define assertmem( x, y ) assert( _CrtIsValidPointer( x, y, true ) )
#else #else
#ifdef GAME_DLL
#define ID_GAME_API __attribute__((visibility ("default")))
#else
#define ID_GAME_API
#endif
#define ALIGN16( x ) x __attribute__ ((aligned (16))) #define ALIGN16( x ) x __attribute__ ((aligned (16)))
#define PACKED __attribute__((packed)) #define PACKED __attribute__((packed))
#define ID_INLINE inline #define ID_INLINE inline
@ -82,6 +92,12 @@ If you have questions concerning this license or the applicable additional terms
#define CPU_EASYARGS 1 #define CPU_EASYARGS 1
#endif #endif
#ifdef GAME_DLL
#define ID_GAME_API __attribute__((visibility ("default")))
#else
#define ID_GAME_API
#endif
#define ALIGN16( x ) x __attribute__ ((aligned (16))) #define ALIGN16( x ) x __attribute__ ((aligned (16)))
#define PACKED __attribute__((packed)) #define PACKED __attribute__((packed))
@ -140,6 +156,12 @@ If you have questions concerning this license or the applicable additional terms
#define _alloca alloca #define _alloca alloca
#define _alloca16( x ) ((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15)) #define _alloca16( x ) ((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15))
#ifdef GAME_DLL
#define ID_GAME_API __attribute__((visibility ("default")))
#else
#define ID_GAME_API
#endif
#define ALIGN16( x ) x #define ALIGN16( x ) x
#define PACKED __attribute__((packed)) #define PACKED __attribute__((packed))