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:
@@ -42,7 +42,7 @@
|
||||
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
// for GCC32
|
||||
#ifndef _WIN32_IE
|
||||
@@ -368,7 +368,7 @@ void Options::setDefaults()
|
||||
fbShowDateTime = true;
|
||||
fbShowBasicExif = true;
|
||||
fbShowExpComp = false;
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
// use windows setting for visibility of hidden files/folders
|
||||
SHELLFLAGSTATE sft = { 0 };
|
||||
SHGetSettings(&sft, SSF_SHOWALLOBJECTS);
|
||||
@@ -577,7 +577,7 @@ void Options::setDefaults()
|
||||
rtSettings.cameraProfilesPath = "";
|
||||
rtSettings.lensProfilesPath = "";
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
const gchar* sysRoot = g_getenv("SystemRoot"); // Returns e.g. "c:\Windows"
|
||||
|
||||
if (sysRoot != NULL) {
|
||||
@@ -933,7 +933,7 @@ void Options::readFromFile(Glib::ustring fname)
|
||||
// GIMP == 1, Photoshop == 2, Custom == 3.
|
||||
editorToSendTo = keyFile.get_integer("External Editor", "EditorKind");
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
auto getIconSerialized = [](const Glib::ustring &executable) {
|
||||
// Backslashes and quotes must be escaped in the text representation of GVariant strings.
|
||||
// See https://www.freedesktop.org/software/gstreamer-sdk/data/docs/2012.5/glib/gvariant-text.html#gvariant-text-strings
|
||||
@@ -1228,7 +1228,7 @@ void Options::readFromFile(Glib::ustring fname)
|
||||
fbShowExpComp = keyFile.get_boolean("File Browser", "BrowserShowsExpComp");
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
if (keyFile.has_key("File Browser", "BrowserShowsHidden")) {
|
||||
fbShowHidden = keyFile.get_boolean("File Browser", "BrowserShowsHidden");
|
||||
}
|
||||
@@ -2399,7 +2399,7 @@ void Options::saveToFile(Glib::ustring fname)
|
||||
keyFile.set_boolean("File Browser", "BrowserShowsDate", fbShowDateTime);
|
||||
keyFile.set_boolean("File Browser", "BrowserShowsExif", fbShowBasicExif);
|
||||
keyFile.set_boolean("File Browser", "BrowserShowsExpComp", fbShowExpComp);
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
keyFile.set_boolean("File Browser", "BrowserShowsHidden", fbShowHidden);
|
||||
#endif
|
||||
keyFile.set_integer("File Browser", "ThumbnailSize", thumbSize);
|
||||
@@ -2788,7 +2788,7 @@ void Options::load(bool lightweight)
|
||||
}
|
||||
} else {
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
WCHAR pathW[MAX_PATH] = {0};
|
||||
|
||||
if (SHGetSpecialFolderPathW(NULL, pathW, CSIDL_LOCAL_APPDATA, false)) {
|
||||
@@ -2838,7 +2838,7 @@ void Options::load(bool lightweight)
|
||||
|
||||
// No environment variable provided, so falling back to the multi user mode, if enabled
|
||||
else if (options.multiUser) {
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
cacheBaseDir = Glib::build_filename(rtdir, "cache");
|
||||
#else
|
||||
#ifdef __APPLE__
|
||||
|
Reference in New Issue
Block a user