Skip to content

Commit 32cc39c

Browse files
committed
Merge remote-tracking branch 'upstream/master'
Conflicts: dep/g3dlite/G3D-v8.0_hotfix6.diff
2 parents f9244bc + 0f5f560 commit 32cc39c

File tree

209 files changed

+1316
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+1316
-536
lines changed

cmake/compiler/mingw/settings.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
2+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
3+
4+
# Set build-directive (used in core to tell which buildtype we used)
5+
add_definitions(-D_BUILD_DIRECTIVE=\\"${CMAKE_BUILD_TYPE}\\")
6+
7+
if(PLATFORM EQUAL 32)
8+
# Required on 32-bit systems to enable SSE2 (standard on x64)
9+
set(SSE_FLAGS "-msse2 -mfpmath=sse")
10+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}")
11+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
12+
endif()
13+
add_definitions(-DHAVE_SSE2 -D__SSE2__)
14+
message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
15+
16+
if( WITH_WARNINGS )
17+
set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors")
18+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
19+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
20+
message(STATUS "GCC: All warnings enabled")
21+
endif()
22+
23+
if( WITH_COREDEBUG )
24+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
25+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
26+
message(STATUS "GCC: Debug-flags set (-g3)")
27+
endif()

cmake/platform/win/settings.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ endif()
2525
# endif()
2626
#endif()
2727

28-
include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake)
28+
if ( MSVC )
29+
include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake)
30+
elseif ( MINGW )
31+
include(${CMAKE_SOURCE_DIR}/cmake/compiler/mingw/settings.cmake)
32+
endif()

cmake/stack_direction.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* Copyright (C) 2009 Sun Microsystems, Inc
2+
3+
This program is free software; you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License as published by
5+
the Free Software Foundation; version 2 of the License.
6+
7+
This program is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
GNU General Public License for more details.
11+
12+
You should have received a copy of the GNU General Public License
13+
along with this program; if not, write to the Free Software
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15+
16+
/* Check stack direction (0-down, 1-up) */
17+
int f(int *a)
18+
{
19+
int b;
20+
return(&b > a)?1:0;
21+
}
22+
/*
23+
Prevent compiler optimizations by calling function
24+
through pointer.
25+
*/
26+
volatile int (*ptr_f)(int *) = f;
27+
int main()
28+
{
29+
int a;
30+
return ptr_f(&a);
31+
}

dep/acelite/ace-v6.1.4_hotfix2.diff

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/dep/acelite/ace/CMakeLists.txt b/dep/acelite/ace/CMakeLists.txt
2+
index eb0f6dd..1f9ffa6 100644
3+
--- a/dep/acelite/ace/CMakeLists.txt
4+
+++ b/dep/acelite/ace/CMakeLists.txt
5+
@@ -341,6 +341,10 @@ add_library(ace SHARED
6+
${ace_PCH_SRC}
7+
)
8+
9+
+if (MINGW) # GCC ignores "#prama comment"
10+
+ target_link_libraries(ace ws2_32 iphlpapi netapi32 mswsock)
11+
+endif()
12+
+
13+
# Generate precompiled header
14+
if( USE_COREPCH )
15+
add_cxx_pch(ace ${ace_PCH_HDR} ${ace_PCH_SRC})

dep/acelite/ace/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ add_library(ace SHARED
341341
${ace_PCH_SRC}
342342
)
343343

344+
if (MINGW) # GCC ignores "#prama comment"
345+
target_link_libraries(ace ws2_32 iphlpapi netapi32 mswsock)
346+
endif()
347+
344348
# Generate precompiled header
345349
if( USE_COREPCH )
346350
add_cxx_pch(ace ${ace_PCH_HDR} ${ace_PCH_SRC})

dep/g3dlite/G3D-v8.0_hotfix6.diff

Lines changed: 103 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,103 @@
1-
--- a/dep/g3dlite/source/uint128.cpp 2013-02-24 14:56:21.000000000 +0100
2-
+++ b/dep/g3dlite/source/uint128.cpp 2013-02-24 20:40:28.000000000 +0100
3-
@@ -17,8 +17,8 @@
4-
5-
// Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros.
6-
// This eliminates the need to and with 0xFFFFFFFF.
7-
- uint32 a [2] = {_a & 0xFFFFFFFF, _a >> 32};
8-
- uint32 b [2] = {_b & 0xFFFFFFFF, _b >> 32};
9-
+ uint32 a [2] = {static_cast<uint32>(_a & 0xFFFFFFFF), static_cast<uint32>(_a >> 32)};
10-
+ uint32 b [2] = {static_cast<uint32>(_b & 0xFFFFFFFF), static_cast<uint32>(_b >> 32)};
11-
12-
uint64 tmp = uint64(a[0]) + b[0];
13-
14-
@@ -35,8 +35,8 @@
15-
16-
// Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros.
17-
// This eliminates the need to and with 0xFFFFFFFF.
18-
- uint32 a [2] = {_a & 0xFFFFFFFF, _a >> 32};
19-
- uint32 b [2] = {_b & 0xFFFFFFFF, _b >> 32};
20-
+ uint32 a [2] = {static_cast<uint32>(_a & 0xFFFFFFFF), static_cast<uint32>(_a >> 32)};
21-
+ uint32 b [2] = {static_cast<uint32>(_b & 0xFFFFFFFF), static_cast<uint32>(_b >> 32)};
22-
23-
uint64 prod [2][2];
24-
for(int i = 0; i < 2; ++i) {
1+
diff --git a/dep/g3dlite/include/G3D/platform.h b/dep/g3dlite/include/G3D/platform.h
2+
index 614c0ed..65616f0 100644
3+
--- a/dep/g3dlite/include/G3D/platform.h
4+
+++ b/dep/g3dlite/include/G3D/platform.h
5+
@@ -51,6 +51,11 @@
6+
7+
#ifdef _MSC_VER
8+
#define G3D_WIN32
9+
+#elif defined(__MINGW32__)
10+
+ #define G3D_WIN32
11+
+ #undef __MSVCRT_VERSION__
12+
+ #define __MSVCRT_VERSION__ 0x0601
13+
+ #include <windows.h>
14+
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
15+
#define G3D_FREEBSD
16+
#define G3D_LINUX
17+
diff --git a/dep/g3dlite/source/FileSystem.cpp b/dep/g3dlite/source/FileSystem.cpp
18+
index 76a3611..f082937 100644
19+
--- a/dep/g3dlite/source/FileSystem.cpp
20+
+++ b/dep/g3dlite/source/FileSystem.cpp
21+
@@ -25,8 +25,11 @@
22+
23+
// Needed for _findfirst
24+
# include <io.h>
25+
-
26+
-#define stat64 _stat64
27+
+# ifdef __MINGW32__
28+
+# define stat64 stat
29+
+# else
30+
+# define stat64 _stat64
31+
+# endif
32+
#else
33+
# include <dirent.h>
34+
# include <fnmatch.h>
35+
diff --git a/dep/g3dlite/source/RegistryUtil.cpp b/dep/g3dlite/source/RegistryUtil.cpp
36+
index fc4cebc..7c9e56f 100644
37+
--- a/dep/g3dlite/source/RegistryUtil.cpp
38+
+++ b/dep/g3dlite/source/RegistryUtil.cpp
39+
@@ -16,6 +16,15 @@
40+
#include "G3D/RegistryUtil.h"
41+
#include "G3D/System.h"
42+
43+
+#ifdef __MINGW32__
44+
+# ifndef HKEY_PERFORMANCE_TEXT
45+
+# define HKEY_PERFORMANCE_TEXT ((HKEY)((LONG)0x80000050))
46+
+# endif
47+
+# ifndef HKEY_PERFORMANCE_NLSTEXT
48+
+# define HKEY_PERFORMANCE_NLSTEXT ((HKEY)((LONG)0x80000060))
49+
+# endif
50+
+#endif
51+
+
52+
namespace G3D {
53+
54+
// static helpers
55+
diff --git a/dep/g3dlite/source/System.cpp b/dep/g3dlite/source/System.cpp
56+
index f6b0e03..281104d 100644
57+
--- a/dep/g3dlite/source/System.cpp
58+
+++ b/dep/g3dlite/source/System.cpp
59+
@@ -564,7 +564,7 @@ void System::getStandardProcessorExtensions() {
60+
#endif
61+
}
62+
63+
-#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */
64+
+#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */
65+
#pragma message("Port System::memcpy SIMD to all platforms")
66+
/** Michael Herf's fast memcpy */
67+
void memcpyMMX(void* dst, const void* src, int nbytes) {
68+
@@ -615,7 +615,7 @@ void memcpyMMX(void* dst, const void* src, int nbytes) {
69+
#endif
70+
71+
void System::memcpy(void* dst, const void* src, size_t numBytes) {
72+
-#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */
73+
+#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */
74+
memcpyMMX(dst, src, numBytes);
75+
#else
76+
::memcpy(dst, src, numBytes);
77+
@@ -625,7 +625,7 @@ void System::memcpy(void* dst, const void* src, size_t numBytes) {
78+
79+
/** Michael Herf's fastest memset. n32 must be filled with the same
80+
character repeated. */
81+
-#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */
82+
+#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */
83+
#pragma message("Port System::memfill SIMD to all platforms")
84+
85+
// On x86 processors, use MMX
86+
@@ -664,7 +664,7 @@ void memfill(void *dst, int n32, unsigned long i) {
87+
88+
89+
void System::memset(void* dst, uint8 value, size_t numBytes) {
90+
-#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */
91+
+#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */
92+
uint32 v = value;
93+
v = v + (v << 8) + (v << 16) + (v << 24);
94+
G3D::memfill(dst, v, numBytes);
95+
@@ -1696,7 +1696,7 @@ std::string System::currentDateString() {
96+
97+
// VC on Intel
98+
void System::cpuid(CPUIDFunction func, uint32& areg, uint32& breg, uint32& creg, uint32& dreg) {
99+
-#if !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit platform */
100+
+#if !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit platforms or using MinGW */
101+
// Can't copy from assembler direct to a function argument (which is on the stack) in VC.
102+
uint32 a,b,c,d;
103+

dep/g3dlite/G3D-v8.0_hotfix7.diff

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--- a/dep/g3dlite/source/uint128.cpp 2013-02-24 14:56:21.000000000 +0100
2+
+++ b/dep/g3dlite/source/uint128.cpp 2013-02-24 20:40:28.000000000 +0100
3+
@@ -17,8 +17,8 @@
4+
5+
// Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros.
6+
// This eliminates the need to and with 0xFFFFFFFF.
7+
- uint32 a [2] = {_a & 0xFFFFFFFF, _a >> 32};
8+
- uint32 b [2] = {_b & 0xFFFFFFFF, _b >> 32};
9+
+ uint32 a [2] = {static_cast<uint32>(_a & 0xFFFFFFFF), static_cast<uint32>(_a >> 32)};
10+
+ uint32 b [2] = {static_cast<uint32>(_b & 0xFFFFFFFF), static_cast<uint32>(_b >> 32)};
11+
12+
uint64 tmp = uint64(a[0]) + b[0];
13+
14+
@@ -35,8 +35,8 @@
15+
16+
// Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros.
17+
// This eliminates the need to and with 0xFFFFFFFF.
18+
- uint32 a [2] = {_a & 0xFFFFFFFF, _a >> 32};
19+
- uint32 b [2] = {_b & 0xFFFFFFFF, _b >> 32};
20+
+ uint32 a [2] = {static_cast<uint32>(_a & 0xFFFFFFFF), static_cast<uint32>(_a >> 32)};
21+
+ uint32 b [2] = {static_cast<uint32>(_b & 0xFFFFFFFF), static_cast<uint32>(_b >> 32)};
22+
23+
uint64 prod [2][2];
24+
for(int i = 0; i < 2; ++i) {

dep/g3dlite/include/G3D/platform.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151

5252
#ifdef _MSC_VER
5353
#define G3D_WIN32
54+
#elif defined(__MINGW32__)
55+
#define G3D_WIN32
56+
#undef __MSVCRT_VERSION__
57+
#define __MSVCRT_VERSION__ 0x0601
58+
#include <windows.h>
5459
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
5560
#define G3D_FREEBSD
5661
#define G3D_LINUX

dep/g3dlite/source/FileSystem.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@
2525

2626
// Needed for _findfirst
2727
# include <io.h>
28-
29-
#define stat64 _stat64
28+
# ifdef __MINGW32__
29+
# define stat64 stat
30+
# else
31+
# define stat64 _stat64
32+
# endif
3033
#else
3134
# include <dirent.h>
3235
# include <fnmatch.h>

0 commit comments

Comments
 (0)