diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index a3c6c6d8b35fa2acd1c5f11b2d0f55e4730f093c..66ead9381d3cc025661379eda362aa95173786b1 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -958,7 +958,7 @@ CheckSCRAMAuth(Port *port, char *shadow_pass, char **logdetail) */ #ifdef ENABLE_GSS -#if defined(WIN32) && !defined(WIN32_ONLY_COMPILER) +#if defined(WIN32) && !defined(_MSC_VER) /* * MIT Kerberos GSSAPI DLL doesn't properly export the symbols for MingW * that contain the OIDs required. Redefine here, values copied diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 0fad8060b17bff28b566fe65929f75b73a445867..f7b205f195e6a5ee4423e7f65de8fdf9340fcc3f 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -85,7 +85,7 @@ #ifdef HAVE_UTIME_H #include <utime.h> #endif -#ifdef WIN32_ONLY_COMPILER /* mstcpip.h is missing on mingw */ +#ifdef _MSC_VER /* mstcpip.h is missing on mingw */ #include <mstcpip.h> #endif diff --git a/src/backend/port/win32/mingwcompat.c b/src/backend/port/win32/mingwcompat.c index 7b525eab819858d51fc6570f1735ce4605b686a8..ca63c6ee27737eb42e8e33262754bb63cb1cff4b 100644 --- a/src/backend/port/win32/mingwcompat.c +++ b/src/backend/port/win32/mingwcompat.c @@ -13,7 +13,7 @@ #include "postgres.h" -#ifndef WIN32_ONLY_COMPILER +#ifndef _MSC_VER /* * MingW defines an extern to this struct, but the actual struct isn't present * in any library. It's trivial enough that we can safely define it diff --git a/src/common/exec.c b/src/common/exec.c index ff592fc170794d942cf96fc52ebc4651211a09d3..bd01c2d9a2782bb434bc9867baa4c841aed2385f 100644 --- a/src/common/exec.c +++ b/src/common/exec.c @@ -35,7 +35,7 @@ #define log_error4(str, param, arg1) (fprintf(stderr, str, param, arg1), fputc('\n', stderr)) #endif -#ifdef WIN32_ONLY_COMPILER +#ifdef _MSC_VER #define getcwd(cwd,len) GetCurrentDirectory(len, cwd) #endif diff --git a/src/include/getaddrinfo.h b/src/include/getaddrinfo.h index b24afc57d536e55006906999e4f9f4dfc7aa931a..c5595142a5ea148ff9e4af91e2f5bb8b8b1190f2 100644 --- a/src/include/getaddrinfo.h +++ b/src/include/getaddrinfo.h @@ -40,7 +40,7 @@ #define EAI_MEMORY (-10) #define EAI_SYSTEM (-11) #else /* WIN32 */ -#ifdef WIN32_ONLY_COMPILER +#ifdef _MSC_VER #ifndef WSA_NOT_ENOUGH_MEMORY #define WSA_NOT_ENOUGH_MEMORY (WSAENOBUFS) #endif diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h index 2d438152382e402d3254793f6a3151a9c11fbdb2..0669b924cf22486655b542c27b9b9de46fce61df 100644 --- a/src/include/libpq/libpq-be.h +++ b/src/include/libpq/libpq-be.h @@ -38,14 +38,14 @@ * that doesn't match the msvc build. It gives a bunch of compiler warnings that we ignore, * but also defines a symbol that simply does not exist. Undefine it again. */ -#ifdef WIN32_ONLY_COMPILER +#ifdef _MSC_VER #undef HAVE_GETADDRINFO #endif #endif /* ENABLE_GSS */ #ifdef ENABLE_SSPI #define SECURITY_WIN32 -#if defined(WIN32) && !defined(WIN32_ONLY_COMPILER) +#if defined(WIN32) && !defined(_MSC_VER) #include <ntsecapi.h> #endif #include <security.h> diff --git a/src/include/port.h b/src/include/port.h index f9635533ea508e5cc990ee6d5e3f313a582fd3c3..c6937e58a8f366935aebdf831ee849a04305a300 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -231,7 +231,7 @@ extern int pgrename(const char *from, const char *to); extern int pgunlink(const char *path); /* Include this first so later includes don't see these defines */ -#ifdef WIN32_ONLY_COMPILER +#ifdef _MSC_VER #include <io.h> #endif diff --git a/src/include/port/atomics.h b/src/include/port/atomics.h index a6ef0f0f6ae6a75b707dbe622e99f1048eb6ce4e..89eb522637a8f94ccbe44a59ff30da7991d6c3dd 100644 --- a/src/include/port/atomics.h +++ b/src/include/port/atomics.h @@ -96,7 +96,7 @@ /* gcc or compatible, including clang and icc */ #elif defined(__GNUC__) || defined(__INTEL_COMPILER) #include "port/atomics/generic-gcc.h" -#elif defined(WIN32_ONLY_COMPILER) +#elif defined(_MSC_VER) #include "port/atomics/generic-msvc.h" #elif defined(__hpux) && defined(__ia64) && !defined(__GNUC__) #include "port/atomics/generic-acc.h" diff --git a/src/include/port/atomics/arch-x86.h b/src/include/port/atomics/arch-x86.h index 363d9680cb18b2a985c8462b6a03db8f9ee52481..bf8152573dd66e0c5673b91b2cc08754f8c97e5f 100644 --- a/src/include/port/atomics/arch-x86.h +++ b/src/include/port/atomics/arch-x86.h @@ -113,14 +113,14 @@ pg_spin_delay_impl(void) { __asm__ __volatile__(" rep; nop \n"); } -#elif defined(WIN32_ONLY_COMPILER) && defined(__x86_64__) +#elif defined(_MSC_VER) && defined(__x86_64__) #define PG_HAVE_SPIN_DELAY static __forceinline void pg_spin_delay_impl(void) { _mm_pause(); } -#elif defined(WIN32_ONLY_COMPILER) +#elif defined(_MSC_VER) #define PG_HAVE_SPIN_DELAY static __forceinline void pg_spin_delay_impl(void) diff --git a/src/include/port/win32.h b/src/include/port/win32.h index 8cc619f68479b684849146c08544ac6df3ca5392..0debb3b3f42a79494f38379ccebc9b06f4f1156c 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -1,9 +1,5 @@ /* src/include/port/win32.h */ -#if defined(_MSC_VER) -#define WIN32_ONLY_COMPILER -#endif - /* * Make sure _WIN32_WINNT has the minimum required value. * Leave a higher value in place. When building with at least Visual @@ -43,7 +39,7 @@ * The Mingw64 headers choke if this is already defined - they * define it themselves. */ -#if !defined(__MINGW64_VERSION_MAJOR) || defined(WIN32_ONLY_COMPILER) +#if !defined(__MINGW64_VERSION_MAJOR) || defined(_MSC_VER) #define _WINSOCKAPI_ #endif #include <winsock2.h> @@ -233,7 +229,7 @@ int setitimer(int which, const struct itimerval * value, struct itimerval * ov * with 64-bit offsets. */ #define pgoff_t __int64 -#ifdef WIN32_ONLY_COMPILER +#ifdef _MSC_VER #define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin) #define ftello(stream) _ftelli64(stream) #else @@ -256,7 +252,7 @@ typedef int gid_t; #endif typedef long key_t; -#ifdef WIN32_ONLY_COMPILER +#ifdef _MSC_VER typedef int pid_t; #endif @@ -416,7 +412,7 @@ extern int pgwin32_is_admin(void); #define unsetenv(x) pgwin32_unsetenv(x) /* Things that exist in MingW headers, but need to be added to MSVC */ -#ifdef WIN32_ONLY_COMPILER +#ifdef _MSC_VER #ifndef _WIN64 typedef long ssize_t; @@ -446,7 +442,7 @@ typedef unsigned short mode_t; /* Pulled from Makefile.port in mingw */ #define DLSUFFIX ".dll" -#endif /* WIN32_ONLY_COMPILER */ +#endif /* _MSC_VER */ /* These aren't provided by either MingW or MSVC */ #define S_IRGRP 0 diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 1ac56ccbb128e5e4e6c36b1bbb2abcdf0c66c7e8..bbf505e246fd0b4bf486dc776fd9e6555de51ba1 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -833,7 +833,7 @@ extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with, #endif -#ifdef WIN32_ONLY_COMPILER +#ifdef _MSC_VER typedef LONG slock_t; #define HAS_TEST_AND_SET diff --git a/src/interfaces/ecpg/test/expected/thread-thread.c b/src/interfaces/ecpg/test/expected/thread-thread.c index 981a763a3f885870ff045d39a85f698078b8b433..61d3c5c6e4eab771c6d4e4b2d94850ad1819fffd 100644 --- a/src/interfaces/ecpg/test/expected/thread-thread.c +++ b/src/interfaces/ecpg/test/expected/thread-thread.c @@ -152,7 +152,7 @@ void *test_thread(void *arg) /* build up connection name, and connect to database */ -#ifndef WIN32_ONLY_COMPILER +#ifndef _MSC_VER snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); #else _snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); diff --git a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c index 5f2d177c4ab63018e0b0e17a7bd9a8ed6fcbe10f..c43c1ada46e8f33b5a72f45bfa6f85f752c2d298 100644 --- a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c +++ b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c @@ -153,7 +153,7 @@ void *test_thread(void *arg) /* build up connection name, and connect to database */ -#ifndef WIN32_ONLY_COMPILER +#ifndef _MSC_VER snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); #else _snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); diff --git a/src/interfaces/ecpg/test/thread/thread.pgc b/src/interfaces/ecpg/test/thread/thread.pgc index d8ee96dd55ab0abf24111ef4d80c62966703a46a..cc23b82484b948c00458589069b4e999626bb8c4 100644 --- a/src/interfaces/ecpg/test/thread/thread.pgc +++ b/src/interfaces/ecpg/test/thread/thread.pgc @@ -103,7 +103,7 @@ void *test_thread(void *arg) EXEC SQL END DECLARE SECTION; /* build up connection name, and connect to database */ -#ifndef WIN32_ONLY_COMPILER +#ifndef _MSC_VER snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); #else _snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); diff --git a/src/interfaces/ecpg/test/thread/thread_implicit.pgc b/src/interfaces/ecpg/test/thread/thread_implicit.pgc index e39b8b80077d90b7ccf265765b0f325210fe1e3c..96e0e993ace5fe291f6131d052d2e9c79d704602 100644 --- a/src/interfaces/ecpg/test/thread/thread_implicit.pgc +++ b/src/interfaces/ecpg/test/thread/thread_implicit.pgc @@ -104,7 +104,7 @@ void *test_thread(void *arg) EXEC SQL END DECLARE SECTION; /* build up connection name, and connect to database */ -#ifndef WIN32_ONLY_COMPILER +#ifndef _MSC_VER snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); #else _snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c index 5fe7e565a01a4d9b98ced15159a350f38f3319e6..74c8739633b80636a5fa1c3aa4b5f2e112c92632 100644 --- a/src/interfaces/libpq/fe-auth.c +++ b/src/interfaces/libpq/fe-auth.c @@ -49,7 +49,7 @@ * GSSAPI authentication system. */ -#if defined(WIN32) && !defined(WIN32_ONLY_COMPILER) +#if defined(WIN32) && !defined(_MSC_VER) /* * MIT Kerberos GSSAPI DLL doesn't properly export the symbols for MingW * that contain the OIDs required. Redefine here, values copied diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index d79a1cfc02a2d8ae82746e95a46cf3c41d0916e9..1739855c634945145bae7402073142a6b18cee52 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -37,7 +37,7 @@ #endif #define near #include <shlobj.h> -#ifdef WIN32_ONLY_COMPILER /* mstcpip.h is missing on mingw */ +#ifdef _MSC_VER /* mstcpip.h is missing on mingw */ #include <mstcpip.h> #endif #else diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index b8ec3418c56d4aa73e07560ca71f1c2ca008ca4e..494804e74f186556da5c8f85e5c39718e72b2d66 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -53,7 +53,7 @@ #ifdef ENABLE_SSPI #define SECURITY_WIN32 -#if defined(WIN32) && !defined(WIN32_ONLY_COMPILER) +#if defined(WIN32) && !defined(_MSC_VER) #include <ntsecapi.h> #endif #include <security.h> diff --git a/src/tools/msvc/ecpg_regression.proj b/src/tools/msvc/ecpg_regression.proj index 58ea18c8fb9454dd418462c4513864eea51b19b5..16f577593cecead19fdde8514a402e6b72d4706d 100644 --- a/src/tools/msvc/ecpg_regression.proj +++ b/src/tools/msvc/ecpg_regression.proj @@ -51,7 +51,7 @@ <!-- Run ECPG and the Visual C++ compiler on the files. Don't bother with dependency check between the steps --> <Exec WorkingDirectory="%(Pgc.RelativeDir)" Command="$(OUTDIR)ecpg\ecpg -I ../../include --regression $(ECPGPARAM) -o %(Pgc.Filename).c %(Pgc.Filename).pgc" /> - <Exec WorkingDirectorY="%(Pgc.RelativeDir)" Command="cl /nologo %(Pgc.FileName).c /TC /MD$(DEBUGLIB) /DENABLE_THREAD_SAFETY /DWIN32 /DWIN32_ONLY_COMPILER /I. /I..\..\include /I..\..\..\libpq /I..\..\..\..\include /link /defaultlib:$(OUTDIR)libecpg\libecpg.lib /defaultlib:$(OUTDIR)libecpg_compat\libecpg_compat.lib /defaultlib:$(OUTDIR)libpgtypes\libpgtypes.lib" /> + <Exec WorkingDirectorY="%(Pgc.RelativeDir)" Command="cl /nologo %(Pgc.FileName).c /TC /MD$(DEBUGLIB) /DENABLE_THREAD_SAFETY /DWIN32 /D_MSC_VER /I. /I..\..\include /I..\..\..\libpq /I..\..\..\..\include /link /defaultlib:$(OUTDIR)libecpg\libecpg.lib /defaultlib:$(OUTDIR)libecpg_compat\libecpg_compat.lib /defaultlib:$(OUTDIR)libpgtypes\libpgtypes.lib" /> </Target> <!-- Clean up all output files -->