From caa7c44052bc213c3c99c2994dd34ae88e399243 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Fri, 22 Mar 2024 23:36:56 +0100 Subject: [PATCH] Cleanup: remove checks for old MSVC versions --- src/os/windows/win32.cpp | 2 +- src/stdafx.h | 27 ++++++--------------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp index b198ed92c4..e5ddba94c0 100644 --- a/src/os/windows/win32.cpp +++ b/src/os/windows/win32.cpp @@ -259,7 +259,7 @@ void CreateConsole() return; } -#if defined(_MSC_VER) && _MSC_VER >= 1900 +#if defined(_MSC_VER) freopen("CONOUT$", "a", stdout); freopen("CONIN$", "r", stdin); freopen("CONOUT$", "a", stderr); diff --git a/src/stdafx.h b/src/stdafx.h index 096e8e6829..850d18adba 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -28,6 +28,12 @@ #if defined(__APPLE__) # include "os/macosx/osx_stdafx.h" +#else +/* It seems that we need to include stdint.h before anything else + * We need INT64_MAX, which for most systems comes from stdint.h. + * For OSX the inclusion is already done in osx_stdafx.h. */ +# define __STDC_LIMIT_MACROS +# include #endif /* __APPLE__ */ #if defined(__HAIKU__) @@ -37,15 +43,6 @@ # define _GNU_SOURCE #endif -/* It seems that we need to include stdint.h before anything else - * We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC - * does not have stdint.h. - * For OSX the inclusion is already done in osx_stdafx.h. */ -#if !defined(__APPLE__) && (!defined(_MSC_VER) || _MSC_VER >= 1600) -# define __STDC_LIMIT_MACROS -# include -#endif - #include #include #include @@ -115,9 +112,6 @@ # pragma warning(disable: 4200) // nonstandard extension used : zero-sized array in struct/union # pragma warning(disable: 4355) // 'this' : used in base member initializer list -# if (_MSC_VER < 1400) // MSVC 2005 safety checks -# error "Only MSVC 2005 or higher are supported. MSVC 2003 and earlier are not! Upgrade your compiler." -# endif /* (_MSC_VER < 1400) */ # pragma warning(disable: 4291) // no matching operator delete found; memory will not be freed if initialization throws an exception (reason: our overloaded functions never throw an exception) # pragma warning(disable: 4996) // 'function': was declared deprecated # pragma warning(disable: 6308) // code analyzer: 'realloc' might return null pointer: assigning null pointer to 't_ptr', which is passed as an argument to 'realloc', will cause the original memory block to be leaked @@ -126,15 +120,6 @@ # pragma warning(disable: 6031) // code analyzer: Return value ignored: 'ReadFile' # pragma warning(disable: 6246) // code analyzer: Local declaration of 'statspec' hides declaration of the same name in outer scope. For additional information, see previous declaration at ... -# if (_MSC_VER == 1500) // Addresses item #13 on http://blogs.msdn.com/b/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx, for Visual Studio 2008 -# define _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY -# include -# endif - -# if (_MSC_VER < 1900) -# define inline __forceinline -# endif - # define CDECL _cdecl # if defined(_WIN32) && !defined(_WIN64)