summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-26 13:45:26 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-26 13:45:26 +0200
commita4bca123363063551676f2b35578a45391845a3a (patch)
treecfd16aa7c2f954a8301dea75f7b69ba253a15c4e
parent666a92c7c2bf449a69234268982ff47eda828444 (diff)
parent814ab59c372cf4c71147636ea7d5cb3bace883c2 (diff)
downloadredot-engine-a4bca123363063551676f2b35578a45391845a3a.tar.gz
Merge pull request #82304 from akien-mga/windows-remove-redundant-MSVC-define
Windows: Remove `MSVC` define redundant with `_MSC_VER`
-rw-r--r--drivers/unix/file_access_unix.cpp17
-rw-r--r--drivers/windows/file_access_windows.cpp1
-rw-r--r--platform/windows/crash_handler_windows.h2
-rw-r--r--platform/windows/detect.py1
4 files changed, 2 insertions, 19 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index d28e0e70b8..ca5a13799e 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -39,18 +39,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
-
-#if defined(UNIX_ENABLED)
#include <unistd.h>
-#endif
-
-#ifdef MSVC
-#define S_ISREG(m) ((m)&_S_IFREG)
-#include <io.h>
-#endif
-#ifndef S_ISREG
-#define S_ISREG(m) ((m)&S_IFREG)
-#endif
void FileAccessUnix::check_errors() const {
ERR_FAIL_NULL_MSG(f, "File must be opened before use.");
@@ -279,16 +268,10 @@ bool FileAccessUnix::file_exists(const String &p_path) {
return false;
}
-#ifdef UNIX_ENABLED
// See if we have access to the file
if (access(filename.utf8().get_data(), F_OK)) {
return false;
}
-#else
- if (_access(filename.utf8().get_data(), 4) == -1) {
- return false;
- }
-#endif
// See if this is a regular file
switch (st.st_mode & S_IFMT) {
diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp
index 98b0c358e8..9d21073f19 100644
--- a/drivers/windows/file_access_windows.cpp
+++ b/drivers/windows/file_access_windows.cpp
@@ -34,6 +34,7 @@
#include "core/os/os.h"
#include "core/string/print_string.h"
+
#include <share.h> // _SH_DENYNO
#include <shlwapi.h>
#define WIN32_LEAN_AND_MEAN
diff --git a/platform/windows/crash_handler_windows.h b/platform/windows/crash_handler_windows.h
index ef5831f10c..3871210977 100644
--- a/platform/windows/crash_handler_windows.h
+++ b/platform/windows/crash_handler_windows.h
@@ -35,7 +35,7 @@
#include <windows.h>
// Crash handler exception only enabled with MSVC
-#if defined(DEBUG_ENABLED) && defined(MSVC)
+#if defined(DEBUG_ENABLED) && defined(_MSC_VER)
#define CRASH_HANDLER_EXCEPTION 1
extern DWORD CrashHandlerException(EXCEPTION_POINTERS *ep);
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 340b95e4ab..7caa0153d7 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -385,7 +385,6 @@ def configure_msvc(env, vcvars_msvc_config):
"WINMIDI_ENABLED",
"TYPED_METHOD_BIND",
"WIN32",
- "MSVC",
"WINVER=%s" % env["target_win_version"],
"_WIN32_WINNT=%s" % env["target_win_version"],
]