summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPeter Eisentraut2019-10-08 08:27:30 +0000
committerPeter Eisentraut2019-10-08 08:50:54 +0000
commit38d8dce61fff09daae0edb6bcdd42b0c7f10ebcd (patch)
treeb590d669ebe12f434b403643b0fcaa12b92cd91e /src/include
parenta7471bd85c05f849e88d6cfe9da3c795008e8f2e (diff)
Remove some code for old unsupported versions of MSVC
As of d9dd406fe281d22d5238d3c26a7182543c711e74, we require MSVC 2013, which means _MSC_VER >= 1800. This means that conditionals about older versions of _MSC_VER can be removed or simplified. Previous code was also in some cases handling MinGW, where _MSC_VER is not defined at all, incorrectly, such as in pg_ctl.c and win32_port.h, leading to some compiler warnings. This should now be handled better. Reviewed-by: Michael Paquier <michael@paquier.xyz>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/pg_config.h.win3233
-rw-r--r--src/include/port/win32.h2
-rw-r--r--src/include/port/win32_port.h12
-rw-r--r--src/include/utils/float.h4
4 files changed, 4 insertions, 47 deletions
diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
index a330df9d9d4..36e6bdc3031 100644
--- a/src/include/pg_config.h.win32
+++ b/src/include/pg_config.h.win32
@@ -268,14 +268,10 @@
/* #undef HAVE_LONG_INT_64 */
/* Define to 1 if the system has the type `long long int'. */
-#if (_MSC_VER > 1200)
#define HAVE_LONG_LONG_INT 1
-#endif
/* Define to 1 if `long long int' works and is 64 bits. */
-#if (_MSC_VER > 1200)
#define HAVE_LONG_LONG_INT_64 1
-#endif
/* Define to 1 if you have the `mbstowcs_l' function. */
#define HAVE_MBSTOWCS_L 1
@@ -347,10 +343,7 @@
/* #undef HAVE_READLINK */
/* Define to 1 if you have the `rint' function. */
-#if (_MSC_VER >= 1800)
#define HAVE_RINT 1
-#endif
-
/* Define to 1 if you have the global variable
'rl_completion_append_character'. */
@@ -387,9 +380,7 @@
#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
/* Define to 1 if stdbool.h conforms to C99. */
-#if (_MSC_VER >= 1800)
#define HAVE_STDBOOL_H 1
-#endif
/* Define to 1 if you have the <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
@@ -415,25 +406,15 @@
/* Define to 1 if you have the `strtoll' function. */
#ifdef HAVE_LONG_LONG_INT_64
#define HAVE_STRTOLL 1
-/* Before VS2013, use Microsoft's nonstandard equivalent function */
-#if (_MSC_VER < 1800)
-#define strtoll _strtoi64
-#endif
#endif
/* Define to 1 if you have the `strtoull' function. */
#ifdef HAVE_LONG_LONG_INT_64
#define HAVE_STRTOULL 1
-/* Before VS2013, use Microsoft's nonstandard equivalent function */
-#if (_MSC_VER < 1800)
-#define strtoull _strtoui64
-#endif
#endif
/* Define to 1 if the system has the type `struct addrinfo'. */
-#if (_MSC_VER > 1200)
#define HAVE_STRUCT_ADDRINFO 1
-#endif
/* Define to 1 if the system has the type `struct cmsgcred'. */
/* #undef HAVE_STRUCT_CMSGCRED */
@@ -445,14 +426,10 @@
/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
-#if (_MSC_VER > 1200)
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
-#endif
/* Define to 1 if `ss_family' is member of `struct sockaddr_storage'. */
-#if (_MSC_VER > 1200)
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
-#endif
/* Define to 1 if `ss_len' is member of `struct sockaddr_storage'. */
/* #undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN */
@@ -710,17 +687,13 @@
/* #undef USE_PAM */
/* Define to 1 to use software CRC-32C implementation (slicing-by-8). */
-#if (_MSC_VER < 1500)
-#define USE_SLICING_BY_8_CRC32C 1
-#endif
+/* #undef USE_SLICING_BY_8_CRC32C */
/* Define to 1 use Intel SSE 4.2 CRC instructions. */
/* #undef USE_SSE42_CRC32C */
/* Define to 1 to use Intel SSE 4.2 CRC instructions with a runtime check. */
-#if (_MSC_VER >= 1500)
#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK
-#endif
/* Define to select SysV-style semaphores. */
/* #undef USE_SYSV_SEMAPHORES */
@@ -758,11 +731,7 @@
/* Define to keyword to use for C99 restrict support, or to nothing if this is
not supported */
/* Works for C and C++ in Visual Studio 2008 and upwards */
-#if (_MSC_VER >= 1500)
#define pg_restrict __restrict
-#else
-#define pg_restrict
-#endif
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 9f48a58aed4..bb2f7540b3d 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -35,7 +35,7 @@
* our errcode() function. Since it's likely to get included by standard
* system headers, pre-emptively include it now.
*/
-#if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H)
+#if defined(_MSC_VER) || defined(HAVE_CRTDEFS_H)
#define errcode __msvc_errcode
#include <crtdefs.h>
#undef errcode
diff --git a/src/include/port/win32_port.h b/src/include/port/win32_port.h
index 4b935178e12..c459a2417da 100644
--- a/src/include/port/win32_port.h
+++ b/src/include/port/win32_port.h
@@ -489,18 +489,6 @@ typedef unsigned short mode_t;
#define W_OK 2
#define R_OK 4
-/*
- * isinf() and isnan() should per spec be in <math.h>, but MSVC older than
- * 2013 does not have them there. It does have _fpclass() and _isnan(), but
- * they're in <float.h>, so include that here even though it means float.h
- * percolates to our whole tree. Recent versions don't require any of this.
- */
-#if (_MSC_VER < 1800)
-#include <float.h>
-#define isinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF))
-#define isnan(x) _isnan(x)
-#endif
-
/* Pulled from Makefile.port in MinGW */
#define DLSUFFIX ".dll"
diff --git a/src/include/utils/float.h b/src/include/utils/float.h
index 543d00e5910..6a4d2bfe094 100644
--- a/src/include/utils/float.h
+++ b/src/include/utils/float.h
@@ -63,7 +63,7 @@ extern int float8_cmp_internal(float8 a, float8 b);
* long lived bug in the Microsoft compilers.
* See http://support.microsoft.com/kb/120968/en-us for details
*/
-#if (_MSC_VER >= 1800)
+#ifdef _MSC_VER
#pragma warning(disable:4756)
#endif
static inline float4
@@ -73,7 +73,7 @@ get_float4_infinity(void)
/* C99 standard way */
return (float4) INFINITY;
#else
-#if (_MSC_VER >= 1800)
+#ifdef _MSC_VER
#pragma warning(default:4756)
#endif