makefile: Fix MinGW build to allow C++ compiles
This commit is contained in:
parent
0e1f84357c
commit
64716dad74
3 changed files with 10 additions and 10 deletions
4
makefile
4
makefile
|
@ -763,7 +763,11 @@ else
|
||||||
endif
|
endif
|
||||||
GCC_VERSION = $(word 3,$(shell $(GCC) --version))
|
GCC_VERSION = $(word 3,$(shell $(GCC) --version))
|
||||||
COMPILER_NAME = GCC Version: $(GCC_VERSION)
|
COMPILER_NAME = GCC Version: $(GCC_VERSION)
|
||||||
|
ifeq (,$(findstring ++,$(GCC)))
|
||||||
CC_STD = -std=gnu99
|
CC_STD = -std=gnu99
|
||||||
|
else
|
||||||
|
CPP_BUILD = 1
|
||||||
|
endif
|
||||||
LTO_EXCLUDE_VERSIONS = 4.5.2
|
LTO_EXCLUDE_VERSIONS = 4.5.2
|
||||||
ifeq (,$(PATH_SEPARATOR))
|
ifeq (,$(PATH_SEPARATOR))
|
||||||
PATH_SEPARATOR := ;
|
PATH_SEPARATOR := ;
|
||||||
|
|
|
@ -1676,7 +1676,7 @@ errno = EINVAL;
|
||||||
#endif
|
#endif
|
||||||
struct _device_type {
|
struct _device_type {
|
||||||
int32 Type;
|
int32 Type;
|
||||||
char *desc;
|
const char *desc;
|
||||||
} DeviceTypes[] = {
|
} DeviceTypes[] = {
|
||||||
{FILE_DEVICE_8042_PORT, "8042_PORT"},
|
{FILE_DEVICE_8042_PORT, "8042_PORT"},
|
||||||
{FILE_DEVICE_ACPI, "ACPI"},
|
{FILE_DEVICE_ACPI, "ACPI"},
|
||||||
|
|
12
sim_sock.c
12
sim_sock.c
|
@ -445,21 +445,19 @@ static HINSTANCE hLib = 0; /* handle to DLL */
|
||||||
static void *hLib = NULL; /* handle to Library */
|
static void *hLib = NULL; /* handle to Library */
|
||||||
#endif
|
#endif
|
||||||
static int lib_loaded = 0; /* 0=not loaded, 1=loaded, 2=library load failed, 3=Func load failed */
|
static int lib_loaded = 0; /* 0=not loaded, 1=loaded, 2=library load failed, 3=Func load failed */
|
||||||
static char* lib_name = "Ws2_32.dll";
|
static const char* lib_name = "Ws2_32.dll";
|
||||||
|
|
||||||
/* load function pointer from DLL */
|
/* load function pointer from DLL */
|
||||||
typedef int (*_func)();
|
typedef int (*_func)();
|
||||||
|
|
||||||
static void load_function(char* function, _func* func_ptr) {
|
static void load_function(const char* function, _func* func_ptr) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
*func_ptr = (_func)GetProcAddress(hLib, function);
|
*func_ptr = (_func)GetProcAddress(hLib, function);
|
||||||
#else
|
#else
|
||||||
*func_ptr = (_func)dlsym(hLib, function);
|
*func_ptr = (_func)dlsym(hLib, function);
|
||||||
#endif
|
#endif
|
||||||
if (*func_ptr == 0) {
|
if (*func_ptr == 0) {
|
||||||
char* msg = "Sockets: Failed to find function '%s' in %s\r\n";
|
sim_printf ("Sockets: Failed to find function '%s' in %s\r\n", function, lib_name);
|
||||||
|
|
||||||
sim_printf (msg, function, lib_name);
|
|
||||||
lib_loaded = 3;
|
lib_loaded = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -476,9 +474,7 @@ int load_ws2(void) {
|
||||||
#endif
|
#endif
|
||||||
if (hLib == 0) {
|
if (hLib == 0) {
|
||||||
/* failed to load DLL */
|
/* failed to load DLL */
|
||||||
char* msg = "Sockets: Failed to load %s\r\n";
|
sim_printf ("Sockets: Failed to load %s\r\n", lib_name);
|
||||||
|
|
||||||
sim_printf (msg, lib_name);
|
|
||||||
lib_loaded = 2;
|
lib_loaded = 2;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue