*/
#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
#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
#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
#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
#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
* 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>
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
/* 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"
{
__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)
/* 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
* 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>
* 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
#endif
typedef long key_t;
-#ifdef WIN32_ONLY_COMPILER
+#ifdef _MSC_VER
typedef int pid_t;
#endif
#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;
/* 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
#endif
-#ifdef WIN32_ONLY_COMPILER
+#ifdef _MSC_VER
typedef LONG slock_t;
#define HAS_TEST_AND_SET
/* 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);
/* 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);
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);
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);
* 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
#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
#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>
<!-- 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 -->