1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Prepare code to be built by MSVC:

o  remove many WIN32_CLIENT_ONLY defines
	o  add WIN32_ONLY_COMPILER define
	o  add 3rd argument to open() for portability
	o  add include/port/win32_msvc directory for
	   system includes

Magnus Hagander
This commit is contained in:
Bruce Momjian
2006-06-07 22:24:46 +00:00
parent 877e296306
commit 399a36a75d
49 changed files with 1154 additions and 220 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.332 2006/05/21 20:19:23 tgl Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.333 2006/06/07 22:24:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,9 +20,7 @@
#include <fcntl.h>
#include <ctype.h>
#include <time.h>
#ifndef WIN32_CLIENT_ONLY
#include <unistd.h>
#endif
#ifndef HAVE_STRDUP
#include "strdup.h"

View File

@@ -23,7 +23,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.127 2006/05/23 19:28:45 momjian Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.128 2006/06/07 22:24:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -34,10 +34,8 @@
#include <signal.h>
#include <time.h>
#ifndef WIN32_CLIENT_ONLY
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
#ifdef WIN32
#include "win32.h"

View File

@@ -26,12 +26,18 @@
#define NOCRYPT
#include <windows.h>
#include <winsock.h>
#include <stdio.h>
#include "win32.h"
#include "postgres_fe.h"
#include "libpq-fe.h"
#include "libpq-int.h"
/* Declared here to avoid pulling in all includes, which causes name collissions */
#ifdef ENABLE_NLS
extern char *
libpq_gettext(const char *msgid)
__attribute__((format_arg(1)));
#else
#define libpq_gettext(x) (x)
#endif
static struct WSErrorEntry
{

View File

@@ -68,6 +68,7 @@ CLEAN :
-@erase "$(INTDIR)\wchar.obj"
-@erase "$(INTDIR)\encnames.obj"
-@erase "$(INTDIR)\pthread-win32.obj"
-@erase "$(INTDIR)\snprintf.obj"
-@erase "$(OUTDIR)\$(OUTFILENAME).lib"
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
-@erase "$(OUTDIR)\libpq.res"
@@ -103,6 +104,7 @@ LIB32_OBJS= \
"$(INTDIR)\pqsignal.obj" \
"$(INTDIR)\wchar.obj" \
"$(INTDIR)\encnames.obj" \
"$(INTDIR)\snprintf.obj" \
"$(INTDIR)\pthread-win32.obj"
@@ -117,7 +119,7 @@ pg_config_paths.h: win32.mak
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /W3 /GX $(OPT) /I "..\..\include" /I. /D "FRONTEND" $(DEBUGDEF) /D\
CPP_PROJ=/nologo /W3 /GX $(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I. /D "FRONTEND" $(DEBUGDEF) /D\
"WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch" /YX\
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c /D "HAVE_VSNPRINTF" /D "HAVE_STRDUP"
@@ -212,6 +214,11 @@ LINK32_OBJS= \
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c
<<
"$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\snprintf.c
<<
.c{$(CPP_OBJS)}.obj:
$(CPP) $(CPP_PROJ) $<