Skip to content

Commit

Permalink
Cleanup: remove checks for old MSVC versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rubidium42 committed Mar 24, 2024
1 parent d09b5aa commit caa7c44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/os/windows/win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
27 changes: 6 additions & 21 deletions src/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
#endif /* __APPLE__ */

#if defined(__HAIKU__)
Expand All @@ -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 <stdint.h>
#endif

#include <algorithm>
#include <array>
#include <bit>
Expand Down Expand Up @@ -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
Expand All @@ -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 <intrin.h>
# endif

# if (_MSC_VER < 1900)
# define inline __forceinline
# endif

# define CDECL _cdecl

# if defined(_WIN32) && !defined(_WIN64)
Expand Down

0 comments on commit caa7c44

Please sign in to comment.