1
0
mirror of https://github.com/godotengine/godot synced 2024-07-08 21:00:44 +00:00

Merge pull request #82304 from akien-mga/windows-remove-redundant-MSVC-define

Windows: Remove `MSVC` define redundant with `_MSC_VER`
This commit is contained in:
Rémi Verschelde 2023-09-26 13:45:26 +02:00
commit a4bca12336
No known key found for this signature in database
GPG Key ID: C3336907360768E1
4 changed files with 2 additions and 19 deletions

View File

@ -39,18 +39,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#if defined(UNIX_ENABLED)
#include <unistd.h> #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 { void FileAccessUnix::check_errors() const {
ERR_FAIL_NULL_MSG(f, "File must be opened before use."); 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; return false;
} }
#ifdef UNIX_ENABLED
// See if we have access to the file // See if we have access to the file
if (access(filename.utf8().get_data(), F_OK)) { if (access(filename.utf8().get_data(), F_OK)) {
return false; return false;
} }
#else
if (_access(filename.utf8().get_data(), 4) == -1) {
return false;
}
#endif
// See if this is a regular file // See if this is a regular file
switch (st.st_mode & S_IFMT) { switch (st.st_mode & S_IFMT) {

View File

@ -34,6 +34,7 @@
#include "core/os/os.h" #include "core/os/os.h"
#include "core/string/print_string.h" #include "core/string/print_string.h"
#include <share.h> // _SH_DENYNO #include <share.h> // _SH_DENYNO
#include <shlwapi.h> #include <shlwapi.h>
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN

View File

@ -35,7 +35,7 @@
#include <windows.h> #include <windows.h>
// Crash handler exception only enabled with MSVC // 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 #define CRASH_HANDLER_EXCEPTION 1
extern DWORD CrashHandlerException(EXCEPTION_POINTERS *ep); extern DWORD CrashHandlerException(EXCEPTION_POINTERS *ep);

View File

@ -385,7 +385,6 @@ def configure_msvc(env, vcvars_msvc_config):
"WINMIDI_ENABLED", "WINMIDI_ENABLED",
"TYPED_METHOD_BIND", "TYPED_METHOD_BIND",
"WIN32", "WIN32",
"MSVC",
"WINVER=%s" % env["target_win_version"], "WINVER=%s" % env["target_win_version"],
"_WIN32_WINNT=%s" % env["target_win_version"], "_WIN32_WINNT=%s" % env["target_win_version"],
] ]