[Scummvm-git-logs] scummvm master -> 1d412701d1297df2b6d4dffb259c68fe664a19fa
bluegr
bluegr at gmail.com
Mon Dec 17 11:28:38 CET 2018
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d0512db25c WIN32: Move all ARRAYSIZE undefs to util.h
272d4105b2 WIN32: Fix libcurl redefining ARRAYSIZE
1d412701d1 WIN32: Always include windows.h before util.h
Commit: d0512db25ce5bbd8f31151c3d2374f344f77f006
https://github.com/scummvm/scummvm/commit/d0512db25ce5bbd8f31151c3d2374f344f77f006
Author: SupSuper (supsuper at gmail.com)
Date: 2018-12-17T12:28:33+02:00
Commit Message:
WIN32: Move all ARRAYSIZE undefs to util.h
Instead of trying to undefine ARRAYSIZE everywhere we use a Windows header, let's just do it before we define our own
Changed paths:
backends/audiocd/win32/win32-audiocd.cpp
backends/dialogs/win32/win32-dialogs.cpp
backends/fs/windows/windows-fs.h
backends/midi/windows.cpp
backends/platform/sdl/win32/win32-main.cpp
backends/platform/sdl/win32/win32-window.cpp
backends/platform/sdl/win32/win32.cpp
backends/saves/windows/windows-saves.cpp
backends/taskbar/win32/win32-taskbar.cpp
common/scummsys.h
common/translation.cpp
common/util.h
engines/engine.cpp
diff --git a/backends/audiocd/win32/win32-audiocd.cpp b/backends/audiocd/win32/win32-audiocd.cpp
index 7269910..9ffcc00 100644
--- a/backends/audiocd/win32/win32-audiocd.cpp
+++ b/backends/audiocd/win32/win32-audiocd.cpp
@@ -46,7 +46,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include "backends/audiocd/win32/win32-audiocd.h"
diff --git a/backends/dialogs/win32/win32-dialogs.cpp b/backends/dialogs/win32/win32-dialogs.cpp
index e34a08c..fca0601 100644
--- a/backends/dialogs/win32/win32-dialogs.cpp
+++ b/backends/dialogs/win32/win32-dialogs.cpp
@@ -56,9 +56,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#if defined(ARRAYSIZE)
-#undef ARRAYSIZE
-#endif
#endif
#include <shlobj.h>
diff --git a/backends/fs/windows/windows-fs.h b/backends/fs/windows/windows-fs.h
index 3758877..4be4cbf 100644
--- a/backends/fs/windows/windows-fs.h
+++ b/backends/fs/windows/windows-fs.h
@@ -25,12 +25,7 @@
#include "backends/fs/abstract-fs.h"
-#if defined(ARRAYSIZE)
-#undef ARRAYSIZE
-#endif
#include <windows.h>
-// winnt.h defines ARRAYSIZE, but we want our own one...
-#undef ARRAYSIZE
#ifdef _WIN32_WCE
#undef GetCurrentDirectory
#endif
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index 52a4620..35608fd 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -29,8 +29,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-// winnt.h defines ARRAYSIZE, but we want our own one...
-#undef ARRAYSIZE
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
diff --git a/backends/platform/sdl/win32/win32-main.cpp b/backends/platform/sdl/win32/win32-main.cpp
index 4e9f6a4..0a7c1dd 100644
--- a/backends/platform/sdl/win32/win32-main.cpp
+++ b/backends/platform/sdl/win32/win32-main.cpp
@@ -33,7 +33,6 @@
// "ARRAYSIZE" for example.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include "backends/platform/sdl/win32/win32.h"
#include "backends/plugins/sdl/sdl-provider.h"
diff --git a/backends/platform/sdl/win32/win32-window.cpp b/backends/platform/sdl/win32/win32-window.cpp
index 8c01da0..47d77a8 100644
--- a/backends/platform/sdl/win32/win32-window.cpp
+++ b/backends/platform/sdl/win32/win32-window.cpp
@@ -29,7 +29,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
void SdlWindow_Win32::setupIcon() {
HMODULE handle = GetModuleHandle(NULL);
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 264a064..e837bbae 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -27,7 +27,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include <shellapi.h>
#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
// required for SHGFP_TYPE_CURRENT in shlobj.h
diff --git a/backends/saves/windows/windows-saves.cpp b/backends/saves/windows/windows-saves.cpp
index fec4828..50564e9 100644
--- a/backends/saves/windows/windows-saves.cpp
+++ b/backends/saves/windows/windows-saves.cpp
@@ -22,12 +22,8 @@
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
-#if defined(ARRAYSIZE)
-#undef ARRAYSIZE
-#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
// required for SHGFP_TYPE_CURRENT in shlobj.h
#define _WIN32_IE 0x500
diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp
index f6706de..1a03bbd 100644
--- a/backends/taskbar/win32/win32-taskbar.cpp
+++ b/backends/taskbar/win32/win32-taskbar.cpp
@@ -55,9 +55,6 @@
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#include <windows.h>
- #if defined(ARRAYSIZE)
- #undef ARRAYSIZE
- #endif
#endif
#include <shlobj.h>
diff --git a/common/scummsys.h b/common/scummsys.h
index 3b22272..b205665 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -117,11 +117,6 @@
#endif
- #if defined(ARRAYSIZE)
- // VS2005beta2 introduces new stuff in winnt.h
- #undef ARRAYSIZE
- #endif
-
#endif
#if defined(__QNXNTO__)
diff --git a/common/translation.cpp b/common/translation.cpp
index 35e5b6e..1debabf 100644
--- a/common/translation.cpp
+++ b/common/translation.cpp
@@ -23,8 +23,6 @@
#if defined(WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-// winnt.h defines ARRAYSIZE, but we want our own one... - this is needed before including util.h
-#undef ARRAYSIZE
#endif
#define TRANSLATIONS_DAT_VER 3
diff --git a/common/util.h b/common/util.h
index 2d6a36d..77d7523 100644
--- a/common/util.h
+++ b/common/util.h
@@ -56,6 +56,10 @@ template<typename T> inline T CLIP(T v, T amin, T amax)
*/
template<typename T> inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; }
+#ifdef ARRAYSIZE
+#undef ARRAYSIZE
+#endif
+
/**
* Macro which determines the number of entries in a fixed size array.
*/
diff --git a/engines/engine.cpp b/engines/engine.cpp
index cc8c013..0e7f64f 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -26,8 +26,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <direct.h>
-// winnt.h defines ARRAYSIZE, but we want our own one...
-#undef ARRAYSIZE
#endif
#include "engines/engine.h"
Commit: 272d4105b274391427f92b25b80cbfe68c7997db
https://github.com/scummvm/scummvm/commit/272d4105b274391427f92b25b80cbfe68c7997db
Author: SupSuper (supsuper at gmail.com)
Date: 2018-12-17T12:28:33+02:00
Commit Message:
WIN32: Fix libcurl redefining ARRAYSIZE
libcurl pulls in Windows headers, so let's include it first to avoid clashing with common headers
Changed paths:
backends/cloud/box/boxstorage.cpp
backends/cloud/box/boxtokenrefresher.cpp
backends/cloud/dropbox/dropboxstorage.cpp
backends/cloud/googledrive/googledrivestorage.cpp
backends/cloud/googledrive/googledrivetokenrefresher.cpp
backends/cloud/onedrive/onedrivestorage.cpp
backends/cloud/onedrive/onedrivetokenrefresher.cpp
backends/networking/curl/connectionmanager.cpp
backends/networking/curl/curljsonrequest.cpp
backends/networking/curl/curlrequest.cpp
backends/networking/curl/networkreadstream.cpp
diff --git a/backends/cloud/box/boxstorage.cpp b/backends/cloud/box/boxstorage.cpp
index fb01521..2671a77 100644
--- a/backends/cloud/box/boxstorage.cpp
+++ b/backends/cloud/box/boxstorage.cpp
@@ -22,6 +22,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/cloud/box/boxstorage.h"
#include "backends/cloud/box/boxlistdirectorybyidrequest.h"
#include "backends/cloud/box/boxtokenrefresher.h"
@@ -33,7 +34,6 @@
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/json.h"
-#include <curl/curl.h>
#ifdef ENABLE_RELEASE
#include "dists/clouds/cloud_keys.h"
diff --git a/backends/cloud/box/boxtokenrefresher.cpp b/backends/cloud/box/boxtokenrefresher.cpp
index b5008ef..5f7ad1d 100644
--- a/backends/cloud/box/boxtokenrefresher.cpp
+++ b/backends/cloud/box/boxtokenrefresher.cpp
@@ -22,12 +22,12 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/cloud/box/boxtokenrefresher.h"
#include "backends/cloud/box/boxstorage.h"
#include "backends/networking/curl/networkreadstream.h"
#include "common/debug.h"
#include "common/json.h"
-#include <curl/curl.h>
namespace Cloud {
namespace Box {
diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp
index c2ca55c..b856c6c 100644
--- a/backends/cloud/dropbox/dropboxstorage.cpp
+++ b/backends/cloud/dropbox/dropboxstorage.cpp
@@ -22,6 +22,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/cloud/dropbox/dropboxstorage.h"
#include "backends/cloud/dropbox/dropboxcreatedirectoryrequest.h"
#include "backends/cloud/dropbox/dropboxinforequest.h"
@@ -33,7 +34,6 @@
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/json.h"
-#include <curl/curl.h>
#ifdef ENABLE_RELEASE
#include "dists/clouds/cloud_keys.h"
diff --git a/backends/cloud/googledrive/googledrivestorage.cpp b/backends/cloud/googledrive/googledrivestorage.cpp
index c00d954..4a870c0 100644
--- a/backends/cloud/googledrive/googledrivestorage.cpp
+++ b/backends/cloud/googledrive/googledrivestorage.cpp
@@ -22,6 +22,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/cloud/googledrive/googledrivestorage.h"
#include "backends/cloud/cloudmanager.h"
#include "backends/cloud/googledrive/googledrivetokenrefresher.h"
@@ -34,7 +35,6 @@
#include "common/debug.h"
#include "common/json.h"
#include "common/debug.h"
-#include <curl/curl.h>
#ifdef ENABLE_RELEASE
#include "dists/clouds/cloud_keys.h"
diff --git a/backends/cloud/googledrive/googledrivetokenrefresher.cpp b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
index a8d9d55..a32a7fc 100644
--- a/backends/cloud/googledrive/googledrivetokenrefresher.cpp
+++ b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
@@ -22,12 +22,12 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/cloud/googledrive/googledrivetokenrefresher.h"
#include "backends/cloud/googledrive/googledrivestorage.h"
#include "backends/networking/curl/networkreadstream.h"
#include "common/debug.h"
#include "common/json.h"
-#include <curl/curl.h>
namespace Cloud {
namespace GoogleDrive {
diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp
index 14e803d..9f7cad2 100644
--- a/backends/cloud/onedrive/onedrivestorage.cpp
+++ b/backends/cloud/onedrive/onedrivestorage.cpp
@@ -22,6 +22,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/cloud/onedrive/onedrivestorage.h"
#include "backends/cloud/cloudmanager.h"
#include "backends/cloud/onedrive/onedrivecreatedirectoryrequest.h"
@@ -34,7 +35,6 @@
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/json.h"
-#include <curl/curl.h>
#ifdef ENABLE_RELEASE
#include "dists/clouds/cloud_keys.h"
diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
index 7104dc6..be6de40 100644
--- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp
+++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
@@ -22,12 +22,12 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/cloud/onedrive/onedrivetokenrefresher.h"
#include "backends/cloud/onedrive/onedrivestorage.h"
#include "backends/networking/curl/networkreadstream.h"
#include "common/debug.h"
#include "common/json.h"
-#include <curl/curl.h>
namespace Cloud {
namespace OneDrive {
diff --git a/backends/networking/curl/connectionmanager.cpp b/backends/networking/curl/connectionmanager.cpp
index d8662ab..7698dda 100644
--- a/backends/networking/curl/connectionmanager.cpp
+++ b/backends/networking/curl/connectionmanager.cpp
@@ -22,12 +22,12 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/networking/curl/connectionmanager.h"
#include "backends/networking/curl/networkreadstream.h"
#include "common/debug.h"
#include "common/system.h"
#include "common/timer.h"
-#include <curl/curl.h>
namespace Common {
diff --git a/backends/networking/curl/curljsonrequest.cpp b/backends/networking/curl/curljsonrequest.cpp
index 7764e11..15fabf9 100644
--- a/backends/networking/curl/curljsonrequest.cpp
+++ b/backends/networking/curl/curljsonrequest.cpp
@@ -22,12 +22,12 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/networking/curl/curljsonrequest.h"
#include "backends/networking/curl/connectionmanager.h"
#include "backends/networking/curl/networkreadstream.h"
#include "common/debug.h"
#include "common/json.h"
-#include <curl/curl.h>
namespace Networking {
diff --git a/backends/networking/curl/curlrequest.cpp b/backends/networking/curl/curlrequest.cpp
index 7ee8d66..a9de30c 100644
--- a/backends/networking/curl/curlrequest.cpp
+++ b/backends/networking/curl/curlrequest.cpp
@@ -22,11 +22,11 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/networking/curl/curlrequest.h"
#include "backends/networking/curl/connectionmanager.h"
#include "backends/networking/curl/networkreadstream.h"
#include "common/textconsole.h"
-#include <curl/curl.h>
namespace Networking {
diff --git a/backends/networking/curl/networkreadstream.cpp b/backends/networking/curl/networkreadstream.cpp
index 2048840..ac8800b 100644
--- a/backends/networking/curl/networkreadstream.cpp
+++ b/backends/networking/curl/networkreadstream.cpp
@@ -22,10 +22,10 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <curl/curl.h>
#include "backends/networking/curl/networkreadstream.h"
#include "backends/networking/curl/connectionmanager.h"
#include "base/version.h"
-#include <curl/curl.h>
namespace Networking {
Commit: 1d412701d1297df2b6d4dffb259c68fe664a19fa
https://github.com/scummvm/scummvm/commit/1d412701d1297df2b6d4dffb259c68fe664a19fa
Author: SupSuper (supsuper at gmail.com)
Date: 2018-12-17T12:28:33+02:00
Commit Message:
WIN32: Always include windows.h before util.h
This avoids Windows trying to stomp our definition of ARRAYSIZE
Changed paths:
backends/fs/windows/windows-fs-factory.cpp
backends/fs/windows/windows-fs.h
diff --git a/backends/fs/windows/windows-fs-factory.cpp b/backends/fs/windows/windows-fs-factory.cpp
index 9d1b13a..86f28a7 100644
--- a/backends/fs/windows/windows-fs-factory.cpp
+++ b/backends/fs/windows/windows-fs-factory.cpp
@@ -25,8 +25,8 @@
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
-#include "backends/fs/windows/windows-fs-factory.h"
#include "backends/fs/windows/windows-fs.h"
+#include "backends/fs/windows/windows-fs-factory.h"
AbstractFSNode *WindowsFilesystemFactory::makeRootFileNode() const {
return new WindowsFilesystemNode();
diff --git a/backends/fs/windows/windows-fs.h b/backends/fs/windows/windows-fs.h
index 4be4cbf..f907a4d 100644
--- a/backends/fs/windows/windows-fs.h
+++ b/backends/fs/windows/windows-fs.h
@@ -23,12 +23,13 @@
#ifndef WINDOWS_FILESYSTEM_H
#define WINDOWS_FILESYSTEM_H
-#include "backends/fs/abstract-fs.h"
-
#include <windows.h>
#ifdef _WIN32_WCE
#undef GetCurrentDirectory
#endif
+
+#include "backends/fs/abstract-fs.h"
+
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
More information about the Scummvm-git-logs
mailing list