Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2011-09-06 15:17:29 +0400
committerAntony Riakiotakis <kalast@gmail.com>2011-09-06 15:17:29 +0400
commitaabd702dbdbba5af116f37c401f6a17f0ac714ca (patch)
tree29234810adab7cb85aab3bd017fbb8b5aa51b91f
parent7062788017cfb2841596d15f7c37612312692195 (diff)
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.
-rw-r--r--CMakeLists.txt2
-rw-r--r--build_files/scons/config/win32-mingw-config.py2
-rw-r--r--intern/guardedalloc/MEM_sys_types.h5
-rw-r--r--source/blender/blenloader/BLO_sys_types.h9
4 files changed, 14 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b54b18aab37..8b5693fb1aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -797,7 +797,7 @@ elseif(WIN32)
else()
# keep GCC spesific stuff here
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")
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py
index c815b76ef73..37d693db560 100644
--- a/build_files/scons/config/win32-mingw-config.py
+++ b/build_files/scons/config/win32-mingw-config.py
@@ -174,7 +174,7 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
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']
diff --git a/intern/guardedalloc/MEM_sys_types.h b/intern/guardedalloc/MEM_sys_types.h
index 48230db23a3..4debb32b5c4 100644
--- a/intern/guardedalloc/MEM_sys_types.h
+++ b/intern/guardedalloc/MEM_sys_types.h
@@ -98,7 +98,8 @@ typedef unsigned long uintptr_t;
#include <inttypes.h>
#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>
#else
@@ -109,12 +110,14 @@ typedef unsigned long uintptr_t;
#endif /* ifdef platform for types */
#ifdef _WIN32
+#ifndef FREE_WINDOWS
#ifndef htonl
#define htonl(x) correctByteOrder(x)
#endif
#ifndef ntohl
#define ntohl(x) correctByteOrder(x)
#endif
+#endif
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
#include <sys/param.h>
#elif defined (__APPLE__)
diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h
index 2114fc34bf1..4b3902dca43 100644
--- a/source/blender/blenloader/BLO_sys_types.h
+++ b/source/blender/blenloader/BLO_sys_types.h
@@ -93,7 +93,8 @@ typedef unsigned long uintptr_t;
#include <inttypes.h>
#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>
#else
@@ -105,8 +106,14 @@ typedef unsigned long uintptr_t;
#ifdef _WIN32
+#ifndef FREE_WINDOWS
+#ifndef htonl
#define htonl(x) correctByteOrder(x)
+#endif
+#ifndef ntohl
#define ntohl(x) correctByteOrder(x)
+#endif
+#endif
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
#include <sys/param.h>
#elif defined (__APPLE__)