fix link issues with MinGW - a substitute declaration(correctByteOrder) for itoln that was not present in MinGW was being used. Duplicated the declaration from <winsock2.h>(tried including but gave some errors) and added the appropriate link library, wsock32, according to MinGW documentation.
This commit is contained in:
@@ -797,7 +797,7 @@ elseif(WIN32)
|
|||||||
else()
|
else()
|
||||||
# keep GCC spesific stuff here
|
# keep GCC spesific stuff here
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
|
set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32")
|
||||||
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
|
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
|
||||||
|
|
||||||
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
|
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
|
||||||
|
@@ -174,7 +174,7 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
|
|||||||
|
|
||||||
CC_WARN = [ '-Wall' ]
|
CC_WARN = [ '-Wall' ]
|
||||||
|
|
||||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid']
|
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32']
|
||||||
|
|
||||||
PLATFORM_LINKFLAGS = ['--stack,2097152']
|
PLATFORM_LINKFLAGS = ['--stack,2097152']
|
||||||
|
|
||||||
|
@@ -98,7 +98,8 @@ typedef unsigned long uintptr_t;
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#elif defined(FREE_WINDOWS)
|
#elif defined(FREE_WINDOWS)
|
||||||
|
/* define htoln here, there must be a syntax error in winsock2.h in MinGW */
|
||||||
|
unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -109,12 +110,14 @@ typedef unsigned long uintptr_t;
|
|||||||
#endif /* ifdef platform for types */
|
#endif /* ifdef platform for types */
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#ifndef FREE_WINDOWS
|
||||||
#ifndef htonl
|
#ifndef htonl
|
||||||
#define htonl(x) correctByteOrder(x)
|
#define htonl(x) correctByteOrder(x)
|
||||||
#endif
|
#endif
|
||||||
#ifndef ntohl
|
#ifndef ntohl
|
||||||
#define ntohl(x) correctByteOrder(x)
|
#define ntohl(x) correctByteOrder(x)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
|
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#elif defined (__APPLE__)
|
#elif defined (__APPLE__)
|
||||||
|
@@ -93,7 +93,8 @@ typedef unsigned long uintptr_t;
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#elif defined(FREE_WINDOWS)
|
#elif defined(FREE_WINDOWS)
|
||||||
|
/* define htoln here, there must be a syntax error in winsock2.h in MinGW */
|
||||||
|
unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -105,8 +106,14 @@ typedef unsigned long uintptr_t;
|
|||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#ifndef FREE_WINDOWS
|
||||||
|
#ifndef htonl
|
||||||
#define htonl(x) correctByteOrder(x)
|
#define htonl(x) correctByteOrder(x)
|
||||||
|
#endif
|
||||||
|
#ifndef ntohl
|
||||||
#define ntohl(x) correctByteOrder(x)
|
#define ntohl(x) correctByteOrder(x)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
|
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#elif defined (__APPLE__)
|
#elif defined (__APPLE__)
|
||||||
|
Reference in New Issue
Block a user