DEVTOOLS: Fix compiling with MinGW

This commit is contained in:
Cameron Cawley 2020-09-06 19:09:53 +01:00
parent 5ae7976242
commit f572ce3d9e
3 changed files with 28 additions and 15 deletions

View file

@ -20,6 +20,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 <stdio.h>
#include "eden.h"

View file

@ -28,6 +28,21 @@
#undef main
#endif // main
#if (defined(_WIN32) || defined(WIN32)) && !defined(__GNUC__)
#define USE_WIN32_API
#endif
#if (defined(_WIN32) || defined(WIN32))
#define _WIN32_WINNT 0x0502
#include <windows.h>
#else
#include <dirent.h>
#include <errno.h>
#include <sstream>
#include <sys/param.h>
#include <sys/stat.h>
#endif
#include "create_project.h"
#include "config.h"
@ -51,20 +66,6 @@
#include <cstring>
#include <ctime>
#if (defined(_WIN32) || defined(WIN32)) && !defined(__GNUC__)
#define USE_WIN32_API
#endif
#if (defined(_WIN32) || defined(WIN32))
#include <windows.h>
#else
#include <dirent.h>
#include <errno.h>
#include <sstream>
#include <sys/param.h>
#include <sys/stat.h>
#endif
namespace {
/**
* Converts the given path to only use slashes as
@ -1199,7 +1200,7 @@ int getInstalledMSVC() {
// Use the registry to get the latest version
if (latest == 0) {
HKEY key;
LSTATUS err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7", 0, KEY_QUERY_VALUE | KEY_WOW64_32KEY, &key);
LONG err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7", 0, KEY_QUERY_VALUE | KEY_WOW64_32KEY, &key);
if (err == ERROR_SUCCESS && key != NULL) {
const MSVCList msvc = getAllMSVCVersions();
for (MSVCList::const_reverse_iterator i = msvc.rbegin(); i != msvc.rend(); ++i) {

View file

@ -1,3 +1,9 @@
// 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 <fstream>
#include <iostream>
#include <sstream>