mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-23 12:53:09 +00:00
Add ID_GAME_API for dllexport/attribute(visibility)
Delete obsolete Game.def exports files
This commit is contained in:
parent
d214a0f819
commit
1507a657d4
6 changed files with 27 additions and 20 deletions
|
@ -138,9 +138,10 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|||
add_definitions(-fno-strict-aliasing)
|
||||
|
||||
CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" cxx_has_fvisibility)
|
||||
if (cxx_has_fvisibility)
|
||||
add_definitions(-fvisibility=hidden)
|
||||
if (NOT cxx_has_fvisibility)
|
||||
message(FATAL_ERROR "Compiler does not support -fvisibility")
|
||||
endif()
|
||||
add_definitions(-fvisibility=hidden)
|
||||
|
||||
# TODO fix these warnings
|
||||
add_definitions(-Wno-sign-compare)
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
EXPORTS
|
||||
GetGameAPI
|
|
@ -134,10 +134,7 @@ static const char* fastEntityList[] = {
|
|||
GetGameAPI
|
||||
============
|
||||
*/
|
||||
#if __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) {
|
||||
extern "C" ID_GAME_API gameExport_t *GetGameAPI( gameImport_t *import ) {
|
||||
|
||||
if ( import->version == GAME_API_VERSION ) {
|
||||
|
||||
|
@ -170,9 +167,6 @@ extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) {
|
|||
|
||||
return &gameExport;
|
||||
}
|
||||
#if __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
/*
|
||||
===========
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
EXPORTS GetGameAPI
|
|
@ -98,11 +98,7 @@ const char *idGameLocal::sufaceTypeNames[ MAX_SURFACE_TYPES ] = {
|
|||
GetGameAPI
|
||||
============
|
||||
*/
|
||||
#if __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) {
|
||||
|
||||
extern "C" ID_GAME_API gameExport_t *GetGameAPI( gameImport_t *import ) {
|
||||
if ( import->version == GAME_API_VERSION ) {
|
||||
|
||||
// set interface pointers used by the game
|
||||
|
@ -134,9 +130,6 @@ extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) {
|
|||
|
||||
return &gameExport;
|
||||
}
|
||||
#if __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
/*
|
||||
===========
|
||||
|
|
|
@ -53,12 +53,22 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#define PATHSEPERATOR_CHAR '\\'
|
||||
|
||||
#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 PACKED
|
||||
#define ID_INLINE __forceinline
|
||||
#define ID_STATIC_TEMPLATE static
|
||||
#define assertmem( x, y ) assert( _CrtIsValidPointer( x, y, true ) )
|
||||
#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 PACKED __attribute__((packed))
|
||||
#define ID_INLINE inline
|
||||
|
@ -82,6 +92,12 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#define CPU_EASYARGS 1
|
||||
#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 PACKED __attribute__((packed))
|
||||
|
@ -140,6 +156,12 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#define _alloca alloca
|
||||
#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 PACKED __attribute__((packed))
|
||||
|
||||
|
|
Loading…
Reference in a new issue