From 1d25779284fe1ba08ecd57e647292a9deb241376 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 3 Jan 2017 13:48:53 -0500 Subject: Update copyright via script for 2017 --- src/include/getaddrinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include/getaddrinfo.h') diff --git a/src/include/getaddrinfo.h b/src/include/getaddrinfo.h index 46aad596c7..952cd44712 100644 --- a/src/include/getaddrinfo.h +++ b/src/include/getaddrinfo.h @@ -13,7 +13,7 @@ * This code will also work on platforms where struct addrinfo is defined * in the system headers but no getaddrinfo() can be located. * - * Copyright (c) 2003-2016, PostgreSQL Global Development Group + * Copyright (c) 2003-2017, PostgreSQL Global Development Group * * src/include/getaddrinfo.h * -- cgit v1.2.3 From 6da56f3f84d430671d5edd8f9336bd744c089e31 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 11 Apr 2017 15:14:26 +0200 Subject: Remove support for bcc and msvc standalone libpq builds This removes the support for building just libpq using Borland C++ or Visual C++. This has not worked properly for years, and given the number of complaints it's clearly not worth the maintenance burden. Building libpq using the standard MSVC build system is of course still supported, along with mingw. --- doc/src/sgml/install-windows.sgml | 117 ---------- src/Makefile.shlib | 16 +- src/bcc32.mak | 47 ---- src/bin/psql/command.c | 4 - src/include/getaddrinfo.h | 2 - src/include/port.h | 2 +- src/include/port/atomics/generic-msvc.h | 1 - src/include/port/win32.h | 31 +-- src/interfaces/libpq/bcc32.mak | 312 --------------------------- src/interfaces/libpq/win32.h | 8 +- src/interfaces/libpq/win32.mak | 366 -------------------------------- src/win32.mak | 32 --- 12 files changed, 8 insertions(+), 930 deletions(-) delete mode 100644 src/bcc32.mak delete mode 100644 src/interfaces/libpq/bcc32.mak delete mode 100644 src/interfaces/libpq/win32.mak delete mode 100644 src/win32.mak (limited to 'src/include/getaddrinfo.h') diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml index b95b04f5d8..f5dfb91ac1 100644 --- a/doc/src/sgml/install-windows.sgml +++ b/doc/src/sgml/install-windows.sgml @@ -34,14 +34,6 @@ Windows. - - Finally, the client access library - (libpq) can be built using - Visual C++ 7.1 or - Borland C++ for compatibility with statically - linked applications built using these tools. - - Building using MinGW or Cygwin uses the normal build system, see @@ -539,113 +531,4 @@ $ENV{DOCROOT}='c:\docbook'; - - - Building <application>libpq</application> with - <productname>Visual C++</productname> or - <productname>Borland C++</productname> - - - Using Visual C++ 7.1-9.0 or - Borland C++ to build libpq is only recommended - if you need a version with different debug/release flags, or if you need a - static library to link into an application. For normal use the - MinGW or - Visual Studio or - Windows SDK method is recommended. - - - - To build the libpq client library using - Visual Studio 7.1 or later, change into the - src directory and type the command: - -nmake /f win32.mak - - - - To build a 64-bit version of the libpq - client library using Visual Studio 8.0 or - later, change into the src - directory and type in the command: - -nmake /f win32.mak CPU=AMD64 - - See the win32.mak file for further details - about supported variables. - - - - To build the libpq client library using - Borland C++, change into the - src directory and type the command: - -make -N -DCFG=Release /f bcc32.mak - - - - - Generated Files - - The following files will be built: - - - - interfaces\libpq\Release\libpq.dll - - - The dynamically linkable frontend library - - - - - - interfaces\libpq\Release\libpqdll.lib - - - Import library to link your programs to libpq.dll - - - - - - interfaces\libpq\Release\libpq.lib - - - Static version of the frontend library - - - - - - - - - Normally you do not need to install any of the client files. You should - place the libpq.dll file in the same directory - as your applications executable file. Do not install - libpq.dll into your Windows, - System or System32 directory unless - absolutely necessary. - If this file is installed using a setup program, then it should - be installed with version checking using the - VERSIONINFO resource included in the file, to - ensure that a newer version of the library is not overwritten. - - - - If you are planning to do development using libpq - on this machine, you will have to add the - src\include and - src\interfaces\libpq subdirectories of the source - tree to the include path in your compiler's settings. - - - - To use the library, you must add the - libpqdll.lib file to your project. (In Visual - C++, just right-click on the project and choose to add it.) - - - diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 35e2dd8690..0ce6d2a145 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -405,30 +405,22 @@ endif # PORTNAME == cygwin || PORTNAME == win32 # tarballs. ifneq (,$(SHLIB_EXPORTS)) -distprep: lib$(NAME)dll.def lib$(NAME)ddll.def blib$(NAME)dll.def +distprep: lib$(NAME)dll.def lib$(NAME)ddll.def UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') lib$(NAME)dll.def: $(SHLIB_EXPORTS) - echo '; DEF file for win32.mak release build and for Makefile.shlib (MinGW)' >$@ + echo '; DEF file for Makefile.shlib (MinGW)' >$@ echo 'LIBRARY LIB$(UC_NAME).dll' >>$@ echo 'EXPORTS' >>$@ sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1@ \2/' $< >>$@ lib$(NAME)ddll.def: $(SHLIB_EXPORTS) - echo '; DEF file for win32.mak debug build' >$@ + echo '; DEF file for Makefile.shlib (MinGW)' >$@ echo 'LIBRARY LIB$(UC_NAME)D.dll' >>$@ echo 'EXPORTS' >>$@ sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1@ \2/' $< >>$@ -blib$(NAME)dll.def: $(SHLIB_EXPORTS) - echo '; DEF file for bcc32.mak (Borland C++ Builder)' >$@ - echo 'LIBRARY BLIB$(UC_NAME)' >>$@ - echo 'EXPORTS' >>$@ - sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ _\1@ \2/' $< >>$@ - echo >>$@ - echo '; Aliases for MS compatible names' >> $@ - sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1= _\1/' $< | sed 's/ *$$//' >>$@ endif # SHLIB_EXPORTS @@ -517,5 +509,5 @@ clean-lib: ifneq (,$(SHLIB_EXPORTS)) maintainer-clean-lib: - rm -f lib$(NAME)dll.def lib$(NAME)ddll.def blib$(NAME)dll.def + rm -f lib$(NAME)dll.def lib$(NAME)ddll.def endif diff --git a/src/bcc32.mak b/src/bcc32.mak deleted file mode 100644 index c691924163..0000000000 --- a/src/bcc32.mak +++ /dev/null @@ -1,47 +0,0 @@ -# src/bcc32.mak - -# Makefile for Borland C++ 5.5 (or compat) -# Top-file makefile for building Win32 libpq with Borland C++. - -!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running MAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE make -DCFG=[Release | Debug] /f bcc32.mak -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Release" (Win32 Release) -!MESSAGE "Debug" (Win32 Debug) -!MESSAGE -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -ALL: - cd include - if not exist pg_config.h copy pg_config.h.win32 pg_config.h - if not exist pg_config_ext.h copy pg_config_ext.h.win32 pg_config_ext.h - if not exist pg_config_os.h copy port\win32.h pg_config_os.h - cd .. - cd interfaces\libpq - make -N -DCFG=$(CFG) /f bcc32.mak - cd ..\.. - echo All Win32 parts have been built! - -CLEAN: - cd interfaces\libpq - make -N -DCFG=Release /f bcc32.mak CLEAN - make -N -DCFG=Debug /f bcc32.mak CLEAN - cd ..\.. - echo All Win32 parts have been cleaned! - -DISTCLEAN: CLEAN - cd include - del pg_config.h pg_config_ext.h pg_config_os.h - cd .. diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 494f468575..859ded71f6 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -8,10 +8,6 @@ #include "postgres_fe.h" #include "command.h" -#ifdef __BORLANDC__ /* needed for BCC */ -#undef mkdir -#endif - #include #include #include diff --git a/src/include/getaddrinfo.h b/src/include/getaddrinfo.h index 952cd44712..b24afc57d5 100644 --- a/src/include/getaddrinfo.h +++ b/src/include/getaddrinfo.h @@ -44,10 +44,8 @@ #ifndef WSA_NOT_ENOUGH_MEMORY #define WSA_NOT_ENOUGH_MEMORY (WSAENOBUFS) #endif -#ifndef __BORLANDC__ #define WSATYPE_NOT_FOUND (WSABASEERR+109) #endif -#endif #define EAI_AGAIN WSATRY_AGAIN #define EAI_BADFLAGS WSAEINVAL #define EAI_FAIL WSANO_RECOVERY diff --git a/src/include/port.h b/src/include/port.h index f4546016e7..f9635533ea 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -403,7 +403,7 @@ extern size_t strlcat(char *dst, const char *src, size_t siz); extern size_t strlcpy(char *dst, const char *src, size_t siz); #endif -#if !defined(HAVE_RANDOM) && !defined(__BORLANDC__) +#if !defined(HAVE_RANDOM) extern long random(void); #endif diff --git a/src/include/port/atomics/generic-msvc.h b/src/include/port/atomics/generic-msvc.h index d5ee6e1bcb..f82cfec8ec 100644 --- a/src/include/port/atomics/generic-msvc.h +++ b/src/include/port/atomics/generic-msvc.h @@ -23,7 +23,6 @@ #error "should be included via atomics.h" #endif -/* Should work on both MSVC and Borland. */ #pragma intrinsic(_ReadWriteBarrier) #define pg_compiler_barrier_impl() _ReadWriteBarrier() diff --git a/src/include/port/win32.h b/src/include/port/win32.h index 4453c90346..8cc619f684 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -1,6 +1,6 @@ /* src/include/port/win32.h */ -#if defined(_MSC_VER) || defined(__BORLANDC__) +#if defined(_MSC_VER) #define WIN32_ONLY_COMPILER #endif @@ -32,9 +32,7 @@ * Always build with SSPI support. Keep it as a #define in case * we want a switch to disable it sometime in the future. */ -#ifndef __BORLANDC__ #define ENABLE_SSPI 1 -#endif /* undefine and redefine after #include */ #undef mkdir @@ -56,9 +54,7 @@ #include #include #include -#ifndef __BORLANDC__ #include /* for non-unicode version */ -#endif #undef near /* Must be here to avoid conflicting with prototype in windows.h */ @@ -207,10 +203,8 @@ #define SIGTTIN 21 #define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */ #define SIGWINCH 28 -#ifndef __BORLANDC__ #define SIGUSR1 30 #define SIGUSR2 31 -#endif /* * New versions of mingw have gettimeofday() and also declare @@ -421,7 +415,7 @@ extern int pgwin32_is_admin(void); #define putenv(x) pgwin32_putenv(x) #define unsetenv(x) pgwin32_unsetenv(x) -/* Things that exist in MingW headers, but need to be added to MSVC & BCC */ +/* Things that exist in MingW headers, but need to be added to MSVC */ #ifdef WIN32_ONLY_COMPILER #ifndef _WIN64 @@ -430,7 +424,6 @@ typedef long ssize_t; typedef __int64 ssize_t; #endif -#ifndef __BORLANDC__ typedef unsigned short mode_t; #define S_IRUSR _S_IREAD @@ -440,7 +433,6 @@ typedef unsigned short mode_t; /* see also S_IRGRP etc below */ #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif /* __BORLANDC__ */ #define F_OK 0 #define W_OK 2 @@ -454,26 +446,9 @@ typedef unsigned short mode_t; /* Pulled from Makefile.port in mingw */ #define DLSUFFIX ".dll" -#ifdef __BORLANDC__ - -/* for port/dirent.c */ -#ifndef INVALID_FILE_ATTRIBUTES -#define INVALID_FILE_ATTRIBUTES ((DWORD) -1) -#endif - -/* for port/open.c */ -#ifndef O_RANDOM -#define O_RANDOM 0x0010 /* File access is primarily random */ -#define O_SEQUENTIAL 0x0020 /* File access is primarily sequential */ -#define O_TEMPORARY 0x0040 /* Temporary file bit */ -#define O_SHORT_LIVED 0x1000 /* Temporary storage file, try not to flush */ -#define _O_SHORT_LIVED O_SHORT_LIVED -#endif /* ifndef O_RANDOM */ -#endif /* __BORLANDC__ */ #endif /* WIN32_ONLY_COMPILER */ /* These aren't provided by either MingW or MSVC */ -#ifndef __BORLANDC__ #define S_IRGRP 0 #define S_IWGRP 0 #define S_IXGRP 0 @@ -482,5 +457,3 @@ typedef unsigned short mode_t; #define S_IWOTH 0 #define S_IXOTH 0 #define S_IRWXO 0 - -#endif /* __BORLANDC__ */ diff --git a/src/interfaces/libpq/bcc32.mak b/src/interfaces/libpq/bcc32.mak deleted file mode 100644 index f541fa8ee6..0000000000 --- a/src/interfaces/libpq/bcc32.mak +++ /dev/null @@ -1,312 +0,0 @@ -# Makefile for Borland C++ 5.5 - -# Will build a Win32 static library libpq.lib -# and a Win32 dynamic library libpq.dll with import library libpqdll.lib - -# Borland C++ base install directory goes here -# BCB=c:\Borland\Bcc55 - -!IF "$(BCB)" == "" -!MESSAGE You must edit bcc32.mak and define BCB at the top -!ERROR missing BCB -!ENDIF - -!IF "$(__NMAKE__)" == "" -!MESSAGE You must use the -N compatibility flag, e.g. make -N -f bcc32.make -!ERROR missing -N -!ENDIF - -!MESSAGE Building the Win32 DLL and Static Library... -!MESSAGE -!IF "$(CFG)" == "" -CFG=Release -!MESSAGE No configuration specified. Defaulting to Release. -!MESSAGE -!ELSE -!MESSAGE Configuration "$(CFG)" -!MESSAGE -!ENDIF - -!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running MAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE make -N -DCFG=[Release | Debug] -f bcc32.mak -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Release" (Win32 Release DLL and Static Library) -!MESSAGE "Debug" (Win32 Debug DLL and Static Library) -!MESSAGE -!ERROR An invalid configuration was specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -!IF "$(CFG)" == "Debug" -DEBUG=1 -OUTDIR=.\Debug -INTDIR=.\Debug -!ELSE -OUTDIR=.\Release -INTDIR=.\Release -!ENDIF - -OUTFILENAME=blibpq - -USERDEFINES=FRONTEND;NDEBUG;WIN32;_WINDOWS - -CPP=bcc32.exe -CPP_PROJ = -I..\..\include\port\win32_msvc;$(BCB)\include;..\..\include;..\..\include\port\win32;..\..\port -n"$(INTDIR)" -WD -c -D$(USERDEFINES) -tWM \ - -a8 -X -w-use -w-par -w-pia -w-csu -w-aus -w-ccc - -!IFDEF DEBUG -CPP_PROJ = $(CPP_PROJ) -Od -r- -k -v -y -vi- -D_DEBUG -!else -CPP_PROJ = $(CPP_PROJ) -O -Oi -OS -DNDEBUG -!endif - -ALL : config "$(OUTDIR)" "$(OUTDIR)\blibpq.dll" "$(OUTDIR)\blibpq.lib" - -CLEAN : - -@erase "$(INTDIR)\getaddrinfo.obj" - -@erase "$(INTDIR)\pgstrcasecmp.obj" - -@erase "$(INTDIR)\pqsignal.obj" - -@erase "$(INTDIR)\thread.obj" - -@erase "$(INTDIR)\inet_aton.obj" - -@erase "$(INTDIR)\crypt.obj" - -@erase "$(INTDIR)\noblock.obj" - -@erase "$(INTDIR)\chklocale.obj" - -@erase "$(INTDIR)\inet_net_ntop.obj" - -@erase "$(INTDIR)\md5.obj" - -@erase "$(INTDIR)\ip.obj" - -@erase "$(INTDIR)\fe-auth.obj" - -@erase "$(INTDIR)\fe-protocol2.obj" - -@erase "$(INTDIR)\fe-protocol3.obj" - -@erase "$(INTDIR)\fe-connect.obj" - -@erase "$(INTDIR)\fe-exec.obj" - -@erase "$(INTDIR)\fe-lobj.obj" - -@erase "$(INTDIR)\fe-misc.obj" - -@erase "$(INTDIR)\fe-print.obj" - -@erase "$(INTDIR)\fe-secure.obj" - -@erase "$(INTDIR)\libpq-events.obj" - -@erase "$(INTDIR)\pqexpbuffer.obj" - -@erase "$(INTDIR)\win32.obj" - -@erase "$(INTDIR)\wchar.obj" - -@erase "$(INTDIR)\encnames.obj" - -@erase "$(INTDIR)\pthread-win32.obj" - -@erase "$(INTDIR)\snprintf.obj" - -@erase "$(INTDIR)\strlcpy.obj" - -@erase "$(INTDIR)\dirent.obj" - -@erase "$(INTDIR)\dirmod.obj" - -@erase "$(INTDIR)\pgsleep.obj" - -@erase "$(INTDIR)\open.obj" - -@erase "$(INTDIR)\system.obj" - -@erase "$(INTDIR)\win32error.obj" - -@erase "$(OUTDIR)\$(OUTFILENAME).lib" - -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib" - -@erase "$(OUTDIR)\libpq.res" - -@erase "$(OUTDIR)\$(OUTFILENAME).dll" - -@erase "$(OUTDIR)\$(OUTFILENAME).tds" - -@erase "$(INTDIR)\pg_config_paths.h" - - -LIB32=tlib.exe -LIB32_FLAGS= -LIB32_OBJS= \ - "$(INTDIR)\win32.obj" \ - "$(INTDIR)\getaddrinfo.obj" \ - "$(INTDIR)\pgstrcasecmp.obj" \ - "$(INTDIR)\pqsignal.obj" \ - "$(INTDIR)\thread.obj" \ - "$(INTDIR)\inet_aton.obj" \ - "$(INTDIR)\crypt.obj" \ - "$(INTDIR)\noblock.obj" \ - "$(INTDIR)\chklocale.obj" \ - "$(INTDIR)\inet_net_ntop.obj" \ - "$(INTDIR)\md5.obj" \ - "$(INTDIR)\ip.obj" \ - "$(INTDIR)\fe-auth.obj" \ - "$(INTDIR)\fe-protocol2.obj" \ - "$(INTDIR)\fe-protocol3.obj" \ - "$(INTDIR)\fe-connect.obj" \ - "$(INTDIR)\fe-exec.obj" \ - "$(INTDIR)\fe-lobj.obj" \ - "$(INTDIR)\fe-misc.obj" \ - "$(INTDIR)\fe-print.obj" \ - "$(INTDIR)\fe-secure.obj" \ - "$(INTDIR)\libpq-events.obj" \ - "$(INTDIR)\pqexpbuffer.obj" \ - "$(INTDIR)\wchar.obj" \ - "$(INTDIR)\encnames.obj" \ - "$(INTDIR)\snprintf.obj" \ - "$(INTDIR)\strlcpy.obj" \ - "$(INTDIR)\dirent.obj" \ - "$(INTDIR)\dirmod.obj" \ - "$(INTDIR)\pgsleep.obj" \ - "$(INTDIR)\open.obj" \ - "$(INTDIR)\system.obj" \ - "$(INTDIR)\win32error.obj" \ - "$(INTDIR)\pthread-win32.obj" - - -config: ..\..\include\pg_config.h ..\..\include\pg_config_ext.h ..\..\include\pg_config_os.h pg_config_paths.h - -..\..\include\pg_config.h: ..\..\include\pg_config.h.win32 - copy ..\..\include\pg_config.h.win32 ..\..\include\pg_config.h - -..\..\include\pg_config_ext.h: ..\..\include\pg_config_ext.h.win32 - copy ..\..\include\pg_config_ext.h.win32 ..\..\include\pg_config_ext.h - -..\..\include\pg_config_os.h: ..\..\include\port\win32.h - copy ..\..\include\port\win32.h ..\..\include\pg_config_os.h - -# Have to use \# so # isn't treated as a comment, but MSVC doesn't like this -pg_config_paths.h: bcc32.mak - echo \#define SYSCONFDIR "" > pg_config_paths.h - -"$(OUTDIR)" : - @if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -RSC=brcc32.exe -RSC_PROJ=-l 0x409 -i$(BCB)\include -fo"$(INTDIR)\libpq.res" - -LINK32=ilink32.exe -LINK32_FLAGS = -Gn -L$(BCB)\lib;$(INTDIR); -x -Tpd -v - -# @<< is a Response file, http://www.opussoftware.com/tutorial/TutMakefile.htm - -"$(OUTDIR)\blibpq.dll": "$(OUTDIR)\blibpq.lib" "$(INTDIR)\libpq.res" blibpqdll.def - $(LINK32) @<< - $(LINK32_FLAGS) + - c0d32.obj , + - $@,, + - "$(OUTDIR)\blibpq.lib" import32.lib cw32mt.lib, + - blibpqdll.def,"$(INTDIR)\libpq.res" -<< - implib -w "$(OUTDIR)\blibpqdll.lib" blibpqdll.def $@ - -"$(INTDIR)\libpq.res" : "$(INTDIR)" libpq-dist.rc - $(RSC) $(RSC_PROJ) libpq-dist.rc - -"$(OUTDIR)\blibpq.lib": $(LIB32_OBJS) - $(LIB32) $@ @<< -+-"$(**: =" &^ -+-")" -<< - - -"$(INTDIR)\getaddrinfo.obj" : ..\..\port\getaddrinfo.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\getaddrinfo.c -<< - -"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\pgstrcasecmp.c -<< - -"$(INTDIR)\pqsignal.obj" : ..\..\port\pqsignal.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\pqsignal.c -<< - -"$(INTDIR)\thread.obj" : ..\..\port\thread.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\thread.c -<< - -"$(INTDIR)\inet_aton.obj" : ..\..\port\inet_aton.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\inet_aton.c -<< - -"$(INTDIR)\crypt.obj" : ..\..\port\crypt.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\crypt.c -<< - -"$(INTDIR)\noblock.obj" : ..\..\port\noblock.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\noblock.c -<< - -"$(INTDIR)\chklocale.obj" : ..\..\port\chklocale.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\chklocale.c -<< - -"$(INTDIR)\inet_net_ntop.obj" : ..\..\port\inet_net_ntop.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\inet_net_ntop.c -<< - -"$(INTDIR)\md5.obj" : ..\..\backend\libpq\md5.c - $(CPP) @<< - $(CPP_PROJ) ..\..\backend\libpq\md5.c -<< - -"$(INTDIR)\ip.obj" : ..\..\backend\libpq\ip.c - $(CPP) @<< - $(CPP_PROJ) ..\..\backend\libpq\ip.c -<< - -"$(INTDIR)\wchar.obj" : ..\..\backend\utils\mb\wchar.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\backend\utils\mb\wchar.c -<< - - -"$(INTDIR)\encnames.obj" : ..\..\backend\utils\mb\encnames.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c -<< - -"$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\snprintf.c -<< - -"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\strlcpy.c -<< - -"$(INTDIR)\dirent.obj" : ..\..\port\dirent.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\dirent.c -<< - -"$(INTDIR)\dirmod.obj" : ..\..\port\dirmod.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\dirmod.c -<< - -"$(INTDIR)\pgsleep.obj" : ..\..\port\pgsleep.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\pgsleep.c -<< - -"$(INTDIR)\open.obj" : ..\..\port\open.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\open.c -<< - -"$(INTDIR)\system.obj" : ..\..\port\system.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\system.c -<< - -"$(INTDIR)\win32error.obj" : ..\..\port\win32error.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\win32error.c -<< - - -.c.obj: - $(CPP) $(CPP_PROJ) $< diff --git a/src/interfaces/libpq/win32.h b/src/interfaces/libpq/win32.h index be00ea73cb..c42d7abfe3 100644 --- a/src/interfaces/libpq/win32.h +++ b/src/interfaces/libpq/win32.h @@ -7,17 +7,11 @@ /* * Some compatibility functions */ -#ifdef __BORLANDC__ -#define _timeb timeb -#define _ftime(a) ftime(a) -#define _errno errno -#define popen(a,b) _popen(a,b) -#else + /* open provided elsewhere */ #define close(a) _close(a) #define read(a,b,c) _read(a,b,c) #define write(a,b,c) _write(a,b,c) -#endif #undef EAGAIN /* doesn't apply on sockets */ #undef EINTR diff --git a/src/interfaces/libpq/win32.mak b/src/interfaces/libpq/win32.mak deleted file mode 100644 index 268991e784..0000000000 --- a/src/interfaces/libpq/win32.mak +++ /dev/null @@ -1,366 +0,0 @@ -# Makefile for Microsoft Visual C++ 7.1-8.0 - -# Will build a static library libpq(d).lib -# and a dynamic library libpq(d).dll with import library libpq(d)dll.lib -# USE_OPENSSL=1 will compile with OpenSSL -# USE_KFW=1 will compile with kfw(kerberos for Windows) -# DEBUG=1 compiles with debugging symbols -# ENABLE_THREAD_SAFETY=1 compiles with threading enabled - -ENABLE_THREAD_SAFETY=1 - -# CPU="i386" or CPU environment of nmake.exe (AMD64 or IA64) - -!IF ("$(CPU)" == "")||("$(CPU)" == "i386") -CPU=i386 -!MESSAGE Building the Win32 static library... -!MESSAGE -!ELSEIF ("$(CPU)" == "IA64")||("$(CPU)" == "AMD64") -ADD_DEFINES=/Wp64 /GS -ADD_SECLIB=bufferoverflowU.lib -!MESSAGE Building the Win64 static library... -!MESSAGE -!ELSE -!MESSAGE Please check a CPU=$(CPU) ? -!MESSAGE CPU=i386 or AMD64 or IA64 -!ERROR Make aborted. -!ENDIF - -!IFDEF DEBUG -OPT=/Od /Zi /MDd -LOPT=/DEBUG -DEBUGDEF=/D _DEBUG -OUTFILENAME=libpqd -!ELSE -OPT=/O2 /MD -LOPT= -DEBUGDEF=/D NDEBUG -OUTFILENAME=libpq -!ENDIF - -!IF "$(SSL_INC)" == "" -SSL_INC=C:\OpenSSL\include -!MESSAGE Using default OpenSSL Include directory: $(SSL_INC) -!ENDIF - -!IF "$(SSL_LIB_PATH)" == "" -SSL_LIB_PATH=C:\OpenSSL\lib\VC -!MESSAGE Using default OpenSSL Library directory: $(SSL_LIB_PATH) -!ENDIF - -!IF "$(KFW_INC)" == "" -KFW_INC=C:\kfw-2.6.5\inc -!MESSAGE Using default Kerberos Include directory: $(KFW_INC) -!ENDIF - -!IF "$(KFW_LIB_PATH)" == "" -KFW_LIB_PATH=C:\kfw-2.6.5\lib\$(CPU) -!MESSAGE Using default Kerberos Library directory: $(KFW_LIB_PATH) -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe -RSC=rc.exe - -!IFDEF DEBUG -OUTDIR=.\Debug -INTDIR=.\Debug -CPP_OBJS=.\Debug/ -!ELSE -OUTDIR=.\Release -INTDIR=.\Release -CPP_OBJS=.\Release/ -!ENDIF - - -ALL : config "$(OUTDIR)\$(OUTFILENAME).lib" "$(OUTDIR)\$(OUTFILENAME).dll" - -CLEAN : - -@erase "$(INTDIR)\getaddrinfo.obj" - -@erase "$(INTDIR)\pgstrcasecmp.obj" - -@erase "$(INTDIR)\pqsignal.obj" - -@erase "$(INTDIR)\thread.obj" - -@erase "$(INTDIR)\inet_aton.obj" - -@erase "$(INTDIR)\crypt.obj" - -@erase "$(INTDIR)\noblock.obj" - -@erase "$(INTDIR)\chklocale.obj" - -@erase "$(INTDIR)\inet_net_ntop.obj" - -@erase "$(INTDIR)\md5.obj" - -@erase "$(INTDIR)\ip.obj" - -@erase "$(INTDIR)\fe-auth.obj" - -@erase "$(INTDIR)\fe-protocol2.obj" - -@erase "$(INTDIR)\fe-protocol3.obj" - -@erase "$(INTDIR)\fe-connect.obj" - -@erase "$(INTDIR)\fe-exec.obj" - -@erase "$(INTDIR)\fe-lobj.obj" - -@erase "$(INTDIR)\fe-misc.obj" - -@erase "$(INTDIR)\fe-print.obj" - -@erase "$(INTDIR)\fe-secure.obj" - -@erase "$(INTDIR)\libpq-events.obj" - -@erase "$(INTDIR)\pqexpbuffer.obj" - -@erase "$(INTDIR)\win32.obj" - -@erase "$(INTDIR)\wchar.obj" - -@erase "$(INTDIR)\encnames.obj" - -@erase "$(INTDIR)\pthread-win32.obj" - -@erase "$(INTDIR)\snprintf.obj" - -@erase "$(INTDIR)\strlcpy.obj" - -@erase "$(INTDIR)\dirent.obj" - -@erase "$(INTDIR)\dirmod.obj" - -@erase "$(INTDIR)\pgsleep.obj" - -@erase "$(INTDIR)\open.obj" - -@erase "$(INTDIR)\system.obj" - -@erase "$(INTDIR)\win32error.obj" - -@erase "$(INTDIR)\win32setlocale.obj" - -@erase "$(OUTDIR)\$(OUTFILENAME).lib" - -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib" - -@erase "$(OUTDIR)\libpq.res" - -@erase "$(OUTDIR)\$(OUTFILENAME).dll" - -@erase "$(OUTDIR)\$(OUTFILENAME)dll.exp" - -@erase "$(OUTDIR)\$(OUTFILENAME).dll.manifest" - -@erase "$(OUTDIR)\*.idb" - -@erase pg_config_paths.h" -!IFDEF USE_OPENSSL - -@erase "$(INTDIR)\fe-secure-openssl.obj" -!ENDIF - - -LIB32=link.exe -lib -LIB32_FLAGS=$(LOPT) /nologo /out:"$(OUTDIR)\$(OUTFILENAME).lib" -LIB32_OBJS= \ - "$(INTDIR)\win32.obj" \ - "$(INTDIR)\getaddrinfo.obj" \ - "$(INTDIR)\pgstrcasecmp.obj" \ - "$(INTDIR)\pqsignal.obj" \ - "$(INTDIR)\thread.obj" \ - "$(INTDIR)\inet_aton.obj" \ - "$(INTDIR)\crypt.obj" \ - "$(INTDIR)\noblock.obj" \ - "$(INTDIR)\chklocale.obj" \ - "$(INTDIR)\inet_net_ntop.obj" \ - "$(INTDIR)\md5.obj" \ - "$(INTDIR)\ip.obj" \ - "$(INTDIR)\fe-auth.obj" \ - "$(INTDIR)\fe-protocol2.obj" \ - "$(INTDIR)\fe-protocol3.obj" \ - "$(INTDIR)\fe-connect.obj" \ - "$(INTDIR)\fe-exec.obj" \ - "$(INTDIR)\fe-lobj.obj" \ - "$(INTDIR)\fe-misc.obj" \ - "$(INTDIR)\fe-print.obj" \ - "$(INTDIR)\fe-secure.obj" \ - "$(INTDIR)\libpq-events.obj" \ - "$(INTDIR)\pqexpbuffer.obj" \ - "$(INTDIR)\wchar.obj" \ - "$(INTDIR)\encnames.obj" \ - "$(INTDIR)\snprintf.obj" \ - "$(INTDIR)\strlcpy.obj" \ - "$(INTDIR)\dirent.obj" \ - "$(INTDIR)\dirmod.obj" \ - "$(INTDIR)\pgsleep.obj" \ - "$(INTDIR)\open.obj" \ - "$(INTDIR)\system.obj" \ - "$(INTDIR)\win32error.obj" \ - "$(INTDIR)\win32setlocale.obj" \ - "$(INTDIR)\pthread-win32.obj" - -!IFDEF USE_OPENSSL -LIB32_OBJS=$(LIB32_OBJS) "$(INTDIR)\fe-secure-openssl.obj" -!ENDIF - - -config: ..\..\include\pg_config.h ..\..\include\pg_config_ext.h pg_config_paths.h ..\..\include\pg_config_os.h - -..\..\include\pg_config.h: ..\..\include\pg_config.h.win32 - copy ..\..\include\pg_config.h.win32 ..\..\include\pg_config.h - -..\..\include\pg_config_ext.h: ..\..\include\pg_config_ext.h.win32 - copy ..\..\include\pg_config_ext.h.win32 ..\..\include\pg_config_ext.h - -..\..\include\pg_config_os.h: - copy ..\..\include\port\win32.h ..\..\include\pg_config_os.h - -pg_config_paths.h: win32.mak - echo #define SYSCONFDIR "" > pg_config_paths.h - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /W3 /EHsc $(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I "..\..\port" /I. /I "$(SSL_INC)" \ - /D "FRONTEND" $(DEBUGDEF) \ - /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch" \ - /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \ - /D "_CRT_SECURE_NO_DEPRECATE" $(ADD_DEFINES) - -!IFDEF USE_OPENSSL -CPP_PROJ=$(CPP_PROJ) /D USE_OPENSSL -SSL_LIBS=ssleay32.lib libeay32.lib gdi32.lib -!ENDIF - -!IFDEF USE_KFW -CPP_PROJ=$(CPP_PROJ) /D KRB5 -KFW_LIBS=krb5_32.lib comerr32.lib gssapi32.lib -!ENDIF - -!IFDEF ENABLE_THREAD_SAFETY -CPP_PROJ=$(CPP_PROJ) /D ENABLE_THREAD_SAFETY -!ENDIF - -CPP_SBRS=. - -RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq.res" - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib secur32.lib $(SSL_LIBS) $(KFW_LIB) $(ADD_SECLIB) \ - /nologo /subsystem:windows /dll $(LOPT) /incremental:no \ - /pdb:"$(OUTDIR)\libpqdll.pdb" /machine:$(CPU) \ - /out:"$(OUTDIR)\$(OUTFILENAME).dll"\ - /implib:"$(OUTDIR)\$(OUTFILENAME)dll.lib" \ - /libpath:"$(SSL_LIB_PATH)" /libpath:"$(KFW_LIB_PATH)" \ - /def:$(OUTFILENAME)dll.def -LINK32_OBJS= \ - "$(OUTDIR)\$(OUTFILENAME).lib" \ - "$(OUTDIR)\libpq.res" - -# @<< is a Response file, http://www.opussoftware.com/tutorial/TutMakefile.htm - -"$(OUTDIR)\$(OUTFILENAME).lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -"$(INTDIR)\libpq.res" : "$(INTDIR)" libpq-dist.rc - $(RSC) $(RSC_PROJ) libpq-dist.rc - - -"$(OUTDIR)\$(OUTFILENAME).dll" : "$(OUTDIR)" "$(INTDIR)\libpq.res" - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< -# Inclusion of manifest -!IF "$(_NMAKE_VER)" != "6.00.8168.0" && "$(_NMAKE_VER)" != "7.00.9466" -!IF "$(_NMAKE_VER)" != "6.00.9782.0" && "$(_NMAKE_VER)" != "7.10.3077" - mt -manifest $(OUTDIR)\$(OUTFILENAME).dll.manifest -outputresource:$(OUTDIR)\$(OUTFILENAME).dll;2 -!ENDIF -!ENDIF - -"$(INTDIR)\getaddrinfo.obj" : ..\..\port\getaddrinfo.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\getaddrinfo.c -<< - -"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\pgstrcasecmp.c -<< - -"$(INTDIR)\pqsignal.obj" : ..\..\port\pqsignal.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\pqsignal.c -<< - -"$(INTDIR)\thread.obj" : ..\..\port\thread.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\thread.c -<< - -"$(INTDIR)\inet_aton.obj" : ..\..\port\inet_aton.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\inet_aton.c -<< - -"$(INTDIR)\crypt.obj" : ..\..\port\crypt.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\crypt.c -<< - -"$(INTDIR)\noblock.obj" : ..\..\port\noblock.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\noblock.c -<< - -"$(INTDIR)\chklocale.obj" : ..\..\port\chklocale.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\chklocale.c -<< - -"$(INTDIR)\inet_net_ntop.obj" : ..\..\port\inet_net_ntop.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\inet_net_ntop.c -<< - -"$(INTDIR)\md5.obj" : ..\..\backend\libpq\md5.c - $(CPP) @<< - $(CPP_PROJ) ..\..\backend\libpq\md5.c -<< - -"$(INTDIR)\ip.obj" : ..\..\backend\libpq\ip.c - $(CPP) @<< - $(CPP_PROJ) ..\..\backend\libpq\ip.c -<< - -"$(INTDIR)\wchar.obj" : ..\..\backend\utils\mb\wchar.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\backend\utils\mb\wchar.c -<< - - -"$(INTDIR)\encnames.obj" : ..\..\backend\utils\mb\encnames.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c -<< - -"$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\snprintf.c -<< - -"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\strlcpy.c -<< - -"$(INTDIR)\dirent.obj" : ..\..\port\dirent.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\dirent.c -<< - -"$(INTDIR)\dirmod.obj" : ..\..\port\dirmod.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\dirmod.c -<< - -"$(INTDIR)\pgsleep.obj" : ..\..\port\pgsleep.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\pgsleep.c -<< - -"$(INTDIR)\open.obj" : ..\..\port\open.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\open.c -<< - -"$(INTDIR)\system.obj" : ..\..\port\system.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\system.c -<< - -"$(INTDIR)\win32error.obj" : ..\..\port\win32error.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\win32error.c -<< - -"$(INTDIR)\win32setlocale.obj" : ..\..\port\win32setlocale.c - $(CPP) @<< - $(CPP_PROJ) /I"." ..\..\port\win32setlocale.c -<< - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c.obj: - $(CPP) $(CPP_PROJ) $< diff --git a/src/win32.mak b/src/win32.mak deleted file mode 100644 index 9699e81003..0000000000 --- a/src/win32.mak +++ /dev/null @@ -1,32 +0,0 @@ -# src/win32.mak - -# Top-file makefile for building Win32 libpq with Visual C++ 7.1. -# (see src/tools/msvc for tools to build with Visual C++ 2005 and newer) - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -ALL: - cd include - if not exist pg_config.h copy pg_config.h.win32 pg_config.h - if not exist pg_config_ext.h copy pg_config_ext.h.win32 pg_config_ext.h - if not exist pg_config_os.h copy port\win32.h pg_config_os.h - cd .. - cd interfaces\libpq - nmake /f win32.mak $(MAKEMACRO) - cd ..\.. - echo All Win32 parts have been built! - -CLEAN: - cd interfaces\libpq - nmake /f win32.mak CLEAN - cd ..\.. - echo All Win32 parts have been cleaned! - -DISTCLEAN: CLEAN - cd include - del pg_config.h pg_config_ext.h pg_config_os.h - cd .. -- cgit v1.2.3 From a4777f35565b80ae10605d6d417e5d173156f7da Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 11 Apr 2017 15:21:25 +0200 Subject: Remove symbol WIN32_ONLY_COMPILER This used to mean "Visual C++ except in those parts where Borland C++ was supported where it meant one of those". Now that we don't support Borland C++ anymore, simplify by using _MSC_VER which is the normal way to detect Visual C++. --- src/backend/libpq/auth.c | 2 +- src/backend/libpq/pqcomm.c | 2 +- src/backend/port/win32/mingwcompat.c | 2 +- src/common/exec.c | 2 +- src/include/getaddrinfo.h | 2 +- src/include/libpq/libpq-be.h | 4 ++-- src/include/port.h | 2 +- src/include/port/atomics.h | 2 +- src/include/port/atomics/arch-x86.h | 4 ++-- src/include/port/win32.h | 14 +++++--------- src/include/storage/s_lock.h | 2 +- src/interfaces/ecpg/test/expected/thread-thread.c | 2 +- src/interfaces/ecpg/test/expected/thread-thread_implicit.c | 2 +- src/interfaces/ecpg/test/thread/thread.pgc | 2 +- src/interfaces/ecpg/test/thread/thread_implicit.pgc | 2 +- src/interfaces/libpq/fe-auth.c | 2 +- src/interfaces/libpq/fe-connect.c | 2 +- src/interfaces/libpq/libpq-int.h | 2 +- src/tools/msvc/ecpg_regression.proj | 2 +- 19 files changed, 25 insertions(+), 29 deletions(-) (limited to 'src/include/getaddrinfo.h') diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index a3c6c6d8b3..66ead9381d 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 0fad8060b1..f7b205f195 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -85,7 +85,7 @@ #ifdef HAVE_UTIME_H #include #endif -#ifdef WIN32_ONLY_COMPILER /* mstcpip.h is missing on mingw */ +#ifdef _MSC_VER /* mstcpip.h is missing on mingw */ #include #endif diff --git a/src/backend/port/win32/mingwcompat.c b/src/backend/port/win32/mingwcompat.c index 7b525eab81..ca63c6ee27 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 ff592fc170..bd01c2d9a2 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 b24afc57d5..c5595142a5 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 2d43815238..0669b924cf 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 #endif #include diff --git a/src/include/port.h b/src/include/port.h index f9635533ea..c6937e58a8 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 #endif diff --git a/src/include/port/atomics.h b/src/include/port/atomics.h index a6ef0f0f6a..89eb522637 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 363d9680cb..bf8152573d 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 8cc619f684..0debb3b3f4 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 @@ -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 1ac56ccbb1..bbf505e246 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 981a763a3f..61d3c5c6e4 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 5f2d177c4a..c43c1ada46 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 d8ee96dd55..cc23b82484 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 e39b8b8007..96e0e993ac 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 5fe7e565a0..74c8739633 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 d79a1cfc02..1739855c63 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -37,7 +37,7 @@ #endif #define near #include -#ifdef WIN32_ONLY_COMPILER /* mstcpip.h is missing on mingw */ +#ifdef _MSC_VER /* mstcpip.h is missing on mingw */ #include #endif #else diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index b8ec3418c5..494804e74f 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 #endif #include diff --git a/src/tools/msvc/ecpg_regression.proj b/src/tools/msvc/ecpg_regression.proj index 58ea18c8fb..16f577593c 100644 --- a/src/tools/msvc/ecpg_regression.proj +++ b/src/tools/msvc/ecpg_regression.proj @@ -51,7 +51,7 @@ - + -- cgit v1.2.3