From ae31662a96903b839d34228720e5c469aeb5cb35 Mon Sep 17 00:00:00 2001 From: Hleb Valoshka <375gnu@gmail.com> Date: Sun, 29 Sep 2019 21:30:25 +0300 Subject: [PATCH] Fix compilation with VC++2015 --- src/celengine/celestia.h | 2 ++ src/celengine/shadermanager.cpp | 1 + src/celengine/solarsys.cpp | 1 + src/celestia/winmain.cpp | 2 +- src/celestia/winsplash.cpp | 10 ++++++++++ src/celutil/formatnum.cpp | 2 +- 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/celengine/celestia.h b/src/celengine/celestia.h index 060f3d76d..fb51a7855 100644 --- a/src/celengine/celestia.h +++ b/src/celengine/celestia.h @@ -13,7 +13,9 @@ #ifdef _MSC_VER #define BROKEN_FRIEND_TEMPLATES +#if _MSC_VER < 1700 #define snprintf _snprintf +#endif #if _MSC_VER >= 1000 // Make VC shut up about long variable names from templates diff --git a/src/celengine/shadermanager.cpp b/src/celengine/shadermanager.cpp index f3347edc0..2c8898cb6 100644 --- a/src/celengine/shadermanager.cpp +++ b/src/celengine/shadermanager.cpp @@ -12,6 +12,7 @@ #include "glext.h" #include "shadermanager.h" #include +#include // for min & max #include #include #include diff --git a/src/celengine/solarsys.cpp b/src/celengine/solarsys.cpp index ad56f9ac3..f7a7dbea2 100644 --- a/src/celengine/solarsys.cpp +++ b/src/celengine/solarsys.cpp @@ -19,6 +19,7 @@ #endif /* ! TARGET_OS_MAC */ #endif /* ! _WIN32 */ +#include // for min & max #include #include #include diff --git a/src/celestia/winmain.cpp b/src/celestia/winmain.cpp index 7ba637252..4af83e3bf 100644 --- a/src/celestia/winmain.cpp +++ b/src/celestia/winmain.cpp @@ -1859,7 +1859,7 @@ bool SetDCPixelFormat(HDC hDC) PFD_SUPPORT_OPENGL | // Support OpenGL calls in window PFD_DOUBLEBUFFER, // Double buffered mode PFD_TYPE_RGBA, // RGBA Color mode - GetDeviceCaps(hDC, BITSPIXEL),// Want the display bit depth + (BYTE)GetDeviceCaps(hDC, BITSPIXEL),// Want the display bit depth 0,0,0,0,0,0, // Not used to select mode 0,0, // Not used to select mode 0,0,0,0,0, // Not used to select mode diff --git a/src/celestia/winsplash.cpp b/src/celestia/winsplash.cpp index b372bc3af..4c6645c44 100644 --- a/src/celestia/winsplash.cpp +++ b/src/celestia/winsplash.cpp @@ -32,12 +32,22 @@ lpfnSetLayeredWindowAttributes winSetLayeredWindowAttributes = NULL; lpfnUpdateLayeredWindow winUpdateLayeredWindow = NULL; #define WS_EX_LAYERED 0x00080000 +#ifndef LWA_COLORKEY #define LWA_COLORKEY 1 +#endif +#ifndef LWA_ALPHA #define LWA_ALPHA 2 +#endif +#ifndef ULW_COLORKEY #define ULW_COLORKEY 1 +#endif +#ifndef ULW_ALPHA #define ULW_ALPHA 2 +#endif +#ifndef ULW_OPAQUE #define ULW_OPAQUE 4 +#endif static LRESULT CALLBACK SplashWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) diff --git a/src/celutil/formatnum.cpp b/src/celutil/formatnum.cpp index 158fecb9f..4714c855e 100644 --- a/src/celutil/formatnum.cpp +++ b/src/celutil/formatnum.cpp @@ -14,7 +14,7 @@ #include "formatnum.h" // HACK: MS Visual C++ has _snprintf declared in stdio.h but not snprintf -#ifdef _WIN32 +#if defined(_MSC_VER) && _MSC_VER < 1700 #define snprintf _snprintf #endif