mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 07:37:52 +00:00
engine: remove LoadLibrary macros, to avoid possible misuse. Although macros moved to game_launch, it's part of it's own problem from now
This commit is contained in:
parent
6b4f55c4bf
commit
7c9f5f8ab1
@ -47,14 +47,8 @@ GNU General Public License for more details.
|
|||||||
#define O_BINARY 0
|
#define O_BINARY 0
|
||||||
#define O_TEXT 0
|
#define O_TEXT 0
|
||||||
#define _mkdir( x ) mkdir( x, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH )
|
#define _mkdir( x ) mkdir( x, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH )
|
||||||
#define LoadLibrary( x ) dlopen( x, RTLD_NOW )
|
|
||||||
#define GetProcAddress( x, y ) dlsym( x, y )
|
|
||||||
#define FreeLibrary( x ) dlclose( x )
|
|
||||||
#elif XASH_DOS4GW
|
#elif XASH_DOS4GW
|
||||||
#define PATH_SPLITTER "\\"
|
#define PATH_SPLITTER "\\"
|
||||||
#define LoadLibrary( x ) (0)
|
|
||||||
#define GetProcAddress( x, y ) (0)
|
|
||||||
#define FreeLibrary( x ) (0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef void* HANDLE;
|
typedef void* HANDLE;
|
||||||
|
@ -34,6 +34,8 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
#include "menu_int.h" // _UPDATE_PAGE macro
|
#include "menu_int.h" // _UPDATE_PAGE macro
|
||||||
|
|
||||||
|
#include "library.h"
|
||||||
|
|
||||||
qboolean error_on_exit = false; // arg for exit();
|
qboolean error_on_exit = false; // arg for exit();
|
||||||
#define DEBUG_BREAK
|
#define DEBUG_BREAK
|
||||||
|
|
||||||
@ -272,7 +274,8 @@ qboolean Sys_LoadLibrary( dll_info_t *dll )
|
|||||||
*func->func = NULL;
|
*func->func = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !dll->link ) dll->link = LoadLibrary ( dll->name ); // environment pathes
|
if( !dll->link )
|
||||||
|
dll->link = COM_LoadLibrary( dll->name, false, true ); // environment pathes
|
||||||
|
|
||||||
// no DLL found
|
// no DLL found
|
||||||
if( !dll->link )
|
if( !dll->link )
|
||||||
@ -307,7 +310,7 @@ void* Sys_GetProcAddress( dll_info_t *dll, const char* name )
|
|||||||
if( !dll || !dll->link ) // invalid desc
|
if( !dll || !dll->link ) // invalid desc
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return (void *)GetProcAddress( dll->link, name );
|
return (void *)COM_GetProcAddress( dll->link, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean Sys_FreeLibrary( dll_info_t *dll )
|
qboolean Sys_FreeLibrary( dll_info_t *dll )
|
||||||
@ -324,7 +327,7 @@ qboolean Sys_FreeLibrary( dll_info_t *dll )
|
|||||||
}
|
}
|
||||||
else Con_Reportf( "Sys_FreeLibrary: Unloading %s\n", dll->name );
|
else Con_Reportf( "Sys_FreeLibrary: Unloading %s\n", dll->name );
|
||||||
|
|
||||||
FreeLibrary( dll->link );
|
COM_FreeLibrary( dll->link );
|
||||||
dll->link = NULL;
|
dll->link = NULL;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -23,6 +23,9 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
#if XASH_POSIX
|
#if XASH_POSIX
|
||||||
#define XASHLIB "libxash." OS_LIB_EXT
|
#define XASHLIB "libxash." OS_LIB_EXT
|
||||||
|
#define LoadLibrary( x ) dlopen( x, RTLD_NOW )
|
||||||
|
#define GetProcAddress( x, y ) dlsym( x, y )
|
||||||
|
#define FreeLibrary( x ) dlclose( x )
|
||||||
#include <unistd.h> // execve
|
#include <unistd.h> // execve
|
||||||
#elif XASH_WIN32
|
#elif XASH_WIN32
|
||||||
#define XASHLIB "xash.dll"
|
#define XASHLIB "xash.dll"
|
||||||
@ -46,7 +49,7 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if XASH_WIN32 || XASH_POSIX
|
#if XASH_WIN32 || XASH_POSIX
|
||||||
#define USE_EXECVE_FOR_CHANGE_GAME 1
|
#define USE_EXECVE_FOR_CHANGE_GAME 0
|
||||||
#else
|
#else
|
||||||
#define USE_EXECVE_FOR_CHANGE_GAME 0
|
#define USE_EXECVE_FOR_CHANGE_GAME 0
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user