common_defs: remove workaround for old MSVC versions

MSVC supposedly supports stdbool.h since Visual Studio 2015
(https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-160#c-standard-library-features-1).
The workaround that was being used is error-prone, so just remove it and
don't support VS versions older than VS2015 anymore.
This commit is contained in:
Eric Biggers committed 2022-06-06 00:23:59 -07:00
1 parent 70c45926bc
commit 790575c1e7
1 file changed
+4 -17
+4 -17
View File
@@ -28,12 +28,12 @@
#ifndef COMMON_COMMON_DEFS_H
#define COMMON_COMMON_DEFS_H
#ifndef _MSC_VER
# include <stdbool.h>
# include <stdlib.h> /* for _byteswap_*() */
#endif
#include <stdbool.h>
#include <stddef.h> /* for size_t */
#include <stdint.h>
#ifndef _MSC_VER
# include <stdlib.h> /* for _byteswap_*() */
#endif
#ifndef FREESTANDING
# include <string.h> /* for memcpy() */
#endif
@@ -52,19 +52,6 @@ typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
/* bool */
#ifdef _MSC_VER
/*
* Old versions of MSVC (e.g. VS2010) don't have the C99 header stdbool.h.
* Beware: the below replacement isn't fully standard, since normally any value
* != 0 should be implicitly cast to a bool with value 1... but that doesn't
* happen if bool is really just an 'int'.
*/
typedef int bool;
# define true 1
# define false 0
#endif
/* ssize_t, if not available in <sys/types.h> */
#ifdef _MSC_VER
# ifdef _WIN64