Commit a8ad8fc7 authored by Oliver Bock's avatar Oliver Bock
Browse files

Restore MinGW compatibility after BOINC's server_stable branch update

parent 3ac5396f
......@@ -514,7 +514,7 @@ set_mingw()
export CC=`which ${TARGET_HOST}-gcc`
export CXX=`which ${TARGET_HOST}-g++`
export CPPFLAGS="-D_WIN32_WINDOWS=0x0410 $CPPFLAGS"
export CPPFLAGS="-D_WIN32_WINDOWS=0x0410 -DMINGW_WIN32 $CPPFLAGS"
}
......@@ -651,9 +651,13 @@ build_boinc_mingw()
prepare_boinc $TAG_GFXAPPS || failure
echo "Patching BOINC..." | tee -a $LOGFILE
# patch: fix BOINC vs. MinGW issues
cd $ROOT/3rdparty/boinc/api || failure
patch boinc_api.h < $ROOT/patches/boinc.boinc_api.h.mingw.patch >> $LOGFILE 2>&1 || failure # patch sent upstream!
cd $ROOT/3rdparty/boinc/lib || failure
# patch: fix a couple of BOINC vs. MinGW issues
patch boinc_win.h < $ROOT/patches/boinc.boinc_win.h.minggw.patch >> $LOGFILE 2>&1 || failure
patch diagnostics.cpp < $ROOT/patches/boinc.diagnostics.cpp.mingw.patch >> $LOGFILE 2>&1 || failure # patch sent upstream!
patch diagnostics_win.cpp < $ROOT/patches/boinc.diagnostics_win.cpp.mingw.1.patch >> $LOGFILE 2>&1 || failure # patch sent upstream!
patch diagnostics_win.cpp < $ROOT/patches/boinc.diagnostics_win.cpp.mingw.2.patch >> $LOGFILE 2>&1 || failure # patch sent upstream!
patch filesys.cpp < $ROOT/patches/boinc.filesys.cpp.mingw.patch >> $LOGFILE 2>&1 || failure
echo "Building BOINC (this may take a while)..." | tee -a $LOGFILE
cd $ROOT/3rdparty/boinc || failure
......
......@@ -14,7 +14,7 @@
#
-CXXFLAGS = $(CXXINCS) $(DEBUG) --include $(BOINCDIR)/version.h -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0501 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O1
-CFLAGS = $(INCS) $(DEBUG) --include $(BOINCDIR)/version.h -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0501 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O1
+CXXFLAGS = $(CXXINCS) $(DEBUG) --include $(BOINCDIR)/version.h -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0410 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O1
+CXXFLAGS = $(CXXINCS) $(DEBUG) --include $(BOINCDIR)/version.h -DMINGW_WIN32 -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0410 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O1
+CFLAGS = $(INCS) $(DEBUG) --include $(BOINCDIR)/version.h -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0410 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O1
......
--- boinc_api.h
+++ boinc_api.h 2009-11-06 16:30:39.000000000 +0100
@@ -22,6 +22,10 @@
#include <Carbon/Carbon.h>
#endif
+#ifdef _WIN32
+#include "boinc_win.h"
+#endif
+
// ANSI C API BEGINS HERE
// Do not put implementation stuff here
--- boinc_win.h
+++ boinc_win.h 2008-06-03 17:35:38.000000000 +0200
@@ -73,6 +73,10 @@
#include <userenv.h>
#include <aclapi.h>
+#if defined(__MINGW32__)
+#include <stdint.h>
+#endif
+
#if !defined(__CYGWIN32__) || defined(USE_WINSOCK)
/* If we're not running under CYGWIN use windows networking */
@@ -108,7 +108,7 @@
#include <commctrl.h>
#include <raserror.h>
-#include <dbghelp.h>
+#include <imagehlp.h>
#include <tlhelp32.h>
#include <io.h>
@@ -141,7 +141,7 @@
// C headers
#include <sys/stat.h>
#include <sys/types.h>
-#include <fcntl.h>
+// #include <fcntl.h>
#include <malloc.h>
#if !defined(__MINGW32__) && !defined(__CYGWIN32__)
@@ -236,9 +236,9 @@
#endif
void __cdecl _fpreset (void);
void __cdecl fpreset (void);
-#define SetClassLongPtr SetClassLong
-#define GCLP_HICON GCL_HICON
-#define GCLP_HICONSM GCL_HICONSM
+// #define SetClassLongPtr SetClassLong
+// #define GCLP_HICON GCL_HICON
+// #define GCLP_HICONSM GCL_HICONSM
#ifdef __cplusplus
}
#endif
--- diagnostics.cpp
+++ diagnostics.cpp 2009-11-06 14:35:59.000000000 +0100
@@ -22,7 +22,7 @@
#include "boinc_win.h"
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
#define snprintf _snprintf
#define strdate _strdate
#define strtime _strtime
--- diagnostics_win.cpp
+++ diagnostics_win.cpp 2009-11-06 15:10:47.000000000 +0100
@@ -22,7 +22,7 @@
#include "boinc_win.h"
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
#define snprintf _snprintf
#define strdate _strdate
#define strtime _strtime
--- diagnostics_win.cpp
+++ diagnostics_win.cpp 2009-11-06 15:00:28.000000000 +0100
@@ -2069,9 +2069,15 @@
// library this function will write whatever trace information it can and
// then throw a breakpoint exception to dump all the rest of the useful
// information.
+#ifdef MINGW_WIN32
+void boinc_catch_signal_invalid_parameter(
+ const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line)
+#else
void boinc_catch_signal_invalid_parameter(
const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t /* pReserved */
-) {
+)
+#endif
+{
fprintf(
stderr,
"ERROR: Invalid parameter detected in function %s. File: %s Line: %d\n",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment