mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +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:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.34 2006/03/05 15:58:27 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.35 2006/06/07 22:24:43 momjian Exp $
|
||||
*
|
||||
* This file and the IPV6 implementation were initially provided by
|
||||
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
|
||||
@@ -20,7 +20,6 @@
|
||||
/* This is intended to be used in both frontend and backend, so use c.h */
|
||||
#include "c.h"
|
||||
|
||||
#ifndef WIN32_CLIENT_ONLY
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
@@ -33,7 +32,6 @@
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#include "libpq/ip.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.c,v 1.7 2005/10/15 02:49:23 momjian Exp $ */
|
||||
/* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.c,v 1.8 2006/06/07 22:24:43 momjian Exp $ */
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include "postgres.h"
|
||||
|
||||
char *dlerror(void);
|
||||
int dlclose(void *handle);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Makefile for backend/port/win32
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $PostgreSQL: pgsql/src/backend/port/win32/Makefile,v 1.7 2006/04/29 20:52:56 tgl Exp $
|
||||
# $PostgreSQL: pgsql/src/backend/port/win32/Makefile,v 1.8 2006/06/07 22:24:43 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -12,7 +12,7 @@ subdir = src/backend/port/win32
|
||||
top_builddir = ../../../..
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
|
||||
OBJS = shmem.o timer.o socket.o signal.o security.o error.o
|
||||
OBJS = shmem.o timer.o socket.o signal.o security.o
|
||||
|
||||
all: SUBSYS.o
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.484 2006/05/19 15:15:37 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.485 2006/06/07 22:24:44 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -1121,7 +1121,7 @@ pmdaemonize(void)
|
||||
ExitPostmaster(1);
|
||||
}
|
||||
#endif
|
||||
i = open(NULL_DEV, O_RDWR);
|
||||
i = open(NULL_DEV, O_RDWR, 0);
|
||||
dup2(i, 0);
|
||||
dup2(i, 1);
|
||||
dup2(i, 2);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.23 2006/03/05 15:58:36 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.24 2006/06/07 22:24:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -153,7 +153,7 @@ SysLoggerMain(int argc, char *argv[])
|
||||
*/
|
||||
if (redirection_done)
|
||||
{
|
||||
int fd = open(NULL_DEV, O_WRONLY);
|
||||
int fd = open(NULL_DEV, O_WRONLY, 0);
|
||||
|
||||
/*
|
||||
* The closes might look redundant, but they are not: we want to be
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.124 2006/04/24 20:36:32 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.125 2006/06/07 22:24:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -80,6 +80,14 @@
|
||||
#define HAVE_FINITE 1
|
||||
#endif
|
||||
|
||||
/* Visual C++ etc lacks NAN, and won't accept 0.0/0.0. NAN definition from
|
||||
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/vclrfNotNumberNANItems.asp
|
||||
*/
|
||||
#if defined(WIN32) && !defined(NAN)
|
||||
static const uint32 nan[2] = {0xffffffff, 0x7fffffff};
|
||||
#define NAN (*(const double *) nan)
|
||||
#endif
|
||||
|
||||
/* not sure what the following should be, but better to make it over-sufficient */
|
||||
#define MAXFLOATWIDTH 64
|
||||
#define MAXDOUBLEWIDTH 128
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.85 2006/05/31 20:58:09 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.86 2006/06/07 22:24:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -16,7 +16,11 @@
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifndef WIN32_ONLY_COMPILER
|
||||
#include "dynloader.h"
|
||||
#else
|
||||
#include "port/dynloader/win32.h"
|
||||
#endif
|
||||
#include "miscadmin.h"
|
||||
#include "utils/dynamic_loader.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Encoding names and routines for work with it. All
|
||||
* in this file is shared bedween FE and BE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.29 2006/02/18 16:15:22 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.30 2006/06/07 22:24:44 momjian Exp $
|
||||
*/
|
||||
#ifdef FRONTEND
|
||||
#include "postgres_fe.h"
|
||||
@@ -13,9 +13,7 @@
|
||||
#include "utils/builtins.h"
|
||||
#endif
|
||||
|
||||
#ifndef WIN32_CLIENT_ONLY
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "mb/pg_wchar.h"
|
||||
#include <ctype.h>
|
||||
|
||||
Reference in New Issue
Block a user