[Scummvm-cvs-logs] scummvm master -> 9e6a640d8dbfcf94d6213a46a993c01e8813a53a
lordhoto
lordhoto at gmail.com
Fri Apr 8 16:52:59 CEST 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9e6a640d8d TOOLS: Allow compilation with MinGW for all our tools again.
Commit: 9e6a640d8dbfcf94d6213a46a993c01e8813a53a
https://github.com/scummvm/scummvm/commit/9e6a640d8dbfcf94d6213a46a993c01e8813a53a
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-04-08T07:51:15-07:00
Commit Message:
TOOLS: Allow compilation with MinGW for all our tools again.
Changed paths:
tools/create_project/create_project.cpp
tools/create_teenagent/create_teenagent.cpp
diff --git a/tools/create_project/create_project.cpp b/tools/create_project/create_project.cpp
index 74a048d..b896e85 100644
--- a/tools/create_project/create_project.cpp
+++ b/tools/create_project/create_project.cpp
@@ -23,6 +23,12 @@
*
*/
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
#include "create_project.h"
#include "codeblocks.h"
@@ -41,7 +47,11 @@
#include <cstdlib>
#include <ctime>
-#if defined(_WIN32) || defined(WIN32)
+#if (defined(_WIN32) || defined(WIN32)) && !defined(__GNUC__)
+#define USE_WIN32_API
+#endif
+
+#ifdef USE_WIN32_API
#include <windows.h>
#else
#include <sstream>
@@ -103,7 +113,7 @@ enum ProjectType {
};
int main(int argc, char *argv[]) {
-#if !(defined(_WIN32) || defined(WIN32))
+#ifndef USE_WIN32_API
// Initialize random number generator for UUID creation
std::srand(std::time(0));
#endif
@@ -860,7 +870,7 @@ bool compareNodes(const FileNode *l, const FileNode *r) {
*/
FileList listDirectory(const std::string &dir) {
FileList result;
-#if defined(_WIN32) || defined(WIN32)
+#ifdef USE_WIN32_API
WIN32_FIND_DATA fileInformation;
HANDLE fileHandle = FindFirstFile((dir + "/*").c_str(), &fileInformation);
@@ -1035,7 +1045,7 @@ ProjectProvider::UUIDMap ProjectProvider::createUUIDMap(const BuildSetup &setup)
}
std::string ProjectProvider::createUUID() const {
-#if defined(_WIN32) || defined(WIN32)
+#ifdef USE_WIN32_API
UUID uuid;
if (UuidCreate(&uuid) != RPC_S_OK)
error("UuidCreate failed");
diff --git a/tools/create_teenagent/create_teenagent.cpp b/tools/create_teenagent/create_teenagent.cpp
index ae88cc5..9a9c00d 100644
--- a/tools/create_teenagent/create_teenagent.cpp
+++ b/tools/create_teenagent/create_teenagent.cpp
@@ -26,6 +26,12 @@
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
More information about the Scummvm-git-logs
mailing list