Use _WIN32 instead of WIN32 to detect Windows

`WIN32` is not defined when building a 64-bit executable on Windows with Clang. `_WIN32` is the more appropriate option here.
http://web.archive.org/web/20191012035921/http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system contains a handy table/matrix of the options and why this is best.
This commit is contained in:
Stephen Shkardoon
2023-08-13 14:11:41 +12:00
parent 9ae8c79c3a
commit 23f2a2fc9f
44 changed files with 128 additions and 128 deletions

View File

@@ -26,7 +26,7 @@
#include "placesbrowser.h"
#include "thumbnail.h"
#ifdef WIN32
#ifdef _WIN32
#include "windows.h"
#endif
@@ -302,7 +302,7 @@ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::Initial
if (options.tabbedUI) {
EditorPanel* epanel;
{
#ifdef WIN32
#ifdef _WIN32
int winGdiHandles = GetGuiResources( GetCurrentProcess(), GR_GDIOBJECTS);
if(winGdiHandles > 0 && winGdiHandles <= 6500) //(old settings 8500) 0 means we don't have the rights to access the function, 8500 because the limit is 10000 and we need about 1500 free handles
//J.Desmis october 2021 I change 8500 to 6500..Why ? because without while increasing size GUI system crash in multieditor
@@ -312,7 +312,7 @@ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::Initial
epanel = Gtk::manage (new EditorPanel ());
parent->addEditorPanel (epanel, pl->thm->getFileName());
}
#ifdef WIN32
#ifdef _WIN32
else {
Glib::ustring msg_ = Glib::ustring("<b>") + M("MAIN_MSG_CANNOTLOAD") + " \"" + escapeHtmlChars(thm->getFileName()) + "\" .\n" + M("MAIN_MSG_TOOMANYOPENEDITORS") + "</b>";
Gtk::MessageDialog msgd (*parent, msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
@@ -339,7 +339,7 @@ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::Initial
Gtk::MessageDialog msgd (*parent, msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msgd.run ();
}
#ifdef WIN32
#ifdef _WIN32
MAXGDIHANDLESREACHED:
#endif
delete pl->pc;