From fd3777f08e8b41b755f660aa5bc5cd35d733bf77 Mon Sep 17 00:00:00 2001 From: xawotihs Date: Sat, 7 Sep 2019 19:46:15 +0200 Subject: [PATCH] Now compile with VS2019 --- JGE/include/DebugRoutines.h | 4 +--- JGE/include/JSocket.h | 1 - JGE/include/JTypes.h | 16 ++++++++++++++-- JGE/include/Threading.h | 4 ++-- JGE/src/JNetwork.cpp | 2 ++ JGE/src/pc/JSocket.cpp | 7 +++++-- projects/mtg/include/PrecompiledHeader.h | 8 +++----- projects/mtg/include/WResource_Fwd.h | 2 +- projects/mtg/src/DeckView.cpp | 1 + 9 files changed, 29 insertions(+), 16 deletions(-) diff --git a/JGE/include/DebugRoutines.h b/JGE/include/DebugRoutines.h index a3cf611d7..e1947602d 100644 --- a/JGE/include/DebugRoutines.h +++ b/JGE/include/DebugRoutines.h @@ -1,9 +1,6 @@ #ifndef DEBUGROUTINES_H #define DEBUGROUTINES_H -// dirty, but I get OS header includes this way -#include "JGE.h" - #include "OutputCapturer.h" #include @@ -25,6 +22,7 @@ std::string ToHex(T* pointer) #ifdef LINUX #define OutputDebugString(val) (std::cerr << val); +#define OutputDebugStringA(val) (std::cerr << val); #endif #ifdef _DEBUG diff --git a/JGE/include/JSocket.h b/JGE/include/JSocket.h index ab8bb2934..0cb139821 100644 --- a/JGE/include/JSocket.h +++ b/JGE/include/JSocket.h @@ -2,7 +2,6 @@ #define _JSOCKET_H_ #include -#include "Threading.h" using namespace std; #define SERVER_PORT 5001 diff --git a/JGE/include/JTypes.h b/JGE/include/JTypes.h index 0a7a23766..10c4c93ba 100644 --- a/JGE/include/JTypes.h +++ b/JGE/include/JTypes.h @@ -26,8 +26,15 @@ #include "JAudio.h" #else - -#include +#ifdef IOS +#include +#else +#include +#endif +//#include +//the MSC version might only define _MSC_STDINT_H_ +//and that might cause redefinition of standard types +//#define _STDINT_H_ #endif @@ -140,9 +147,14 @@ typedef uint32_t u32; #include #include #elif defined (WIN32) || defined (LINUX) +#if defined(__APPLE__) +#include +#include +#else #include #include #endif +#endif #else #include #endif diff --git a/JGE/include/Threading.h b/JGE/include/Threading.h index adfe4084e..915f01e49 100644 --- a/JGE/include/Threading.h +++ b/JGE/include/Threading.h @@ -1,7 +1,7 @@ #ifndef THREADING_H #define THREADING_H -#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L) +#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L) && !(_MSC_VER >= 1700) #include #ifdef WIN32 @@ -537,7 +537,7 @@ namespace boost } } -#elif (__cplusplus > 199711L) +#elif (__cplusplus > 199711L) || (_MSC_VER >= 1700) #include #include diff --git a/JGE/src/JNetwork.cpp b/JGE/src/JNetwork.cpp index 769764a52..572a39472 100644 --- a/JGE/src/JNetwork.cpp +++ b/JGE/src/JNetwork.cpp @@ -4,6 +4,8 @@ */ +#define __STDC_LIMIT_MACROS + #include "../include/DebugRoutines.h" #include "../include/JNetwork.h" diff --git a/JGE/src/pc/JSocket.cpp b/JGE/src/pc/JSocket.cpp index f04d36913..41bd7e89e 100644 --- a/JGE/src/pc/JSocket.cpp +++ b/JGE/src/pc/JSocket.cpp @@ -1,10 +1,14 @@ +#define __STDC_LIMIT_MACROS + +#include "../../include/DebugRoutines.h" +#include "Threading.h" + #include #ifdef WIN32 #pragma comment(lib,"WSOCK32.LIB") #include #include #include -#include #include #elif LINUX #include @@ -16,7 +20,6 @@ #endif //WINDOWS #include "../../include/JSocket.h" -#include "../../include/DebugRoutines.h" JSocket::JSocket(string ipAddr) diff --git a/projects/mtg/include/PrecompiledHeader.h b/projects/mtg/include/PrecompiledHeader.h index 97df7a34b..4c3a23630 100644 --- a/projects/mtg/include/PrecompiledHeader.h +++ b/projects/mtg/include/PrecompiledHeader.h @@ -1,6 +1,9 @@ #ifndef PRECOMPILEDHEADER_H #define PRECOMPILEDHEADER_H + +#define __STDC_LIMIT_MACROS + #include #include #include @@ -21,11 +24,6 @@ #include "GameOptions.h" -#if !defined(WP8) && !defined(QT_CONFIG) -#include -#include -#endif - #if defined (WP8) || defined (IOS) || defined (ANDROID) || defined (QT_CONFIG) || defined (SDL_CONFIG) #define TOUCH_ENABLED #endif diff --git a/projects/mtg/include/WResource_Fwd.h b/projects/mtg/include/WResource_Fwd.h index 096f4df97..84af909c3 100644 --- a/projects/mtg/include/WResource_Fwd.h +++ b/projects/mtg/include/WResource_Fwd.h @@ -1,7 +1,7 @@ #ifndef WRESOURCE_FWD_H #define WRESOURCE_FWD_H -#if (__cplusplus > 199711L) +#if (__cplusplus > 199711L) || (_MSC_VER >= 1700) #include typedef std::shared_ptr JQuadPtr; #elif defined(QT_CONFIG) diff --git a/projects/mtg/src/DeckView.cpp b/projects/mtg/src/DeckView.cpp index f5f21ed83..006237ecf 100644 --- a/projects/mtg/src/DeckView.cpp +++ b/projects/mtg/src/DeckView.cpp @@ -1,3 +1,4 @@ +#include "PrecompiledHeader.h" #include "DeckView.h" #include "GameOptions.h"