]> granicus.if.org Git - postgresql/commitdiff
Remove WIN32 defines. They never worked.
authorBruce Momjian <bruce@momjian.us>
Fri, 14 Feb 1997 04:19:07 +0000 (04:19 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 14 Feb 1997 04:19:07 +0000 (04:19 +0000)
26 files changed:
src/backend/libpq/pqcomm.c
src/backend/libpq/pqpacket.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/xfunc.c
src/backend/parser/parser.c
src/backend/parser/scan.l
src/backend/postmaster/postmaster.c
src/backend/storage/file/fd.c
src/backend/storage/ipc/s_lock.c
src/backend/storage/lmgr/proc.c
src/backend/storage/smgr/md.c
src/backend/tcop/postgres.c
src/backend/utils/adt/date.c
src/backend/utils/adt/filename.c
src/backend/utils/adt/float.c
src/backend/utils/error/elog.c
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/init/findbe.c
src/backend/utils/init/miscinit.c
src/backend/utils/init/postinit.c
src/include/c.h
src/include/libpq/libpq-fs.h
src/include/storage/fd.h
src/include/storage/proc.h
src/include/utils/dynamic_loader.h
src/utils/version.c

index cb654723861d5cc5ae8a49fefaee86e01f10a34f..928bc281b8d9a3f773e36ebd6fb89e1e5522c6fb 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.10 1996/12/26 22:07:03 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.11 1997/02/14 04:15:29 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include <signal.h>
 #include <errno.h>
 #include <fcntl.h>
-#ifndef WIN32
 #include <unistd.h>            /* for ttyname() */
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#else
-#include <winsock.h>
-#endif /* WIN32 */
 
 #if defined(linux)
 #ifndef SOMAXCONN
@@ -77,17 +73,8 @@ int PQAsyncNotifyWaiting;    /* for async. notification */
 void
 pq_init(int fd)
 {
-#ifdef WIN32
-    int in, out;
-
-    in = _open_osfhandle(fd, _O_RDONLY);
-    out = _open_osfhandle(fd, _O_APPEND);
-    Pfin = fdopen(in, "rb");
-    Pfout = fdopen(out, "wb");
-#else
     Pfin = fdopen(fd, "r");
     Pfout = fdopen(dup(fd), "w");
-#endif /* WIN32 */
     if (!Pfin || !Pfout)
        elog(FATAL, "pq_init: Couldn't initialize socket connection");
     PQnotifies_init();
@@ -487,10 +474,6 @@ pq_getinserv(struct sockaddr_in *sin, char *host, char *serv)
 void
 pq_regoob(void (*fptr)())
 {
-#ifdef WIN32
-    /* Who knows what to do here? */
-    return;
-#else
     int fd = fileno(Pfout);
 #if defined(hpux)
     ioctl(fd, FIOSSAIOOWN, getpid());
@@ -498,15 +481,12 @@ pq_regoob(void (*fptr)())
     fcntl(fd, F_SETOWN, getpid());
 #endif /* hpux */
     (void) pqsignal(SIGURG,fptr);
-#endif /* WIN32 */    
 }
 
 void
 pq_unregoob()
 {
-#ifndef WIN32
     pqsignal(SIGURG,SIG_DFL);
-#endif /* WIN32 */    
 }
 
 
@@ -554,15 +534,6 @@ StreamServerPort(char *hostName, short portName, int *fdP)
     int                        fd;
     int                 one = 1;
     
-#ifdef WIN32
-    /* This is necessary to make it possible for a backend to use
-    ** stdio to read from the socket.
-    */
-    int optionvalue = SO_SYNCHRONOUS_NONALERT;
-
-    setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&optionvalue,
-              sizeof(optionvalue));
-#endif /* WIN32 */
 
     if (! hostName)
        hostName = "localhost";
@@ -648,10 +619,8 @@ StreamConnection(int server_fd, Port *port)
     
     port->mask = 1 << port->sock;
 
-#ifndef WIN32    
     /* reset to non-blocking */
     fcntl(port->sock, F_SETFL, 1);
-#endif /* WIN32 */    
     
     return(STATUS_OK);
 }
index eddeb97040abd6676420dce5e9db9223a833db4e..5190ec5d8844c461920f947365c47137f355dc9a 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.3 1997/02/13 08:06:36 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.4 1997/02/14 04:15:31 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
  */
 #include <stdio.h>
 #include <sys/types.h>
-#ifndef WIN32
 #include <sys/socket.h>
 #include <netdb.h>
 #include <netinet/in.h>
-#else
-#include <winsock.h>
-#endif /*WIN32 */
 #include <fcntl.h>
 #include <errno.h>
 
index 82553ccf99ef0c65e230e9d2696633151cf80833..779756f7953b14069956b427eccdab6ef4596fbe 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.12 1997/01/26 16:06:42 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.13 1997/02/14 04:15:35 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include "config.h"
 
 #include <math.h>
-#ifdef WIN32
-# include <float.h>
+#ifdef HAVE_LIMITS_H
 # include <limits.h>
-# define MAXINT        INT_MAX
+# ifndef MAXINT
+#  define MAXINT       INT_MAX
+# endif
 #else
-# ifdef HAVE_LIMITS_H
-#  include <limits.h>
-#  ifndef MAXINT
-#   define MAXINT      INT_MAX
-#  endif
-# else
-#  ifdef HAVE_VALUES_H
-#   include <values.h>
-#  endif
-# endif 
+# ifdef HAVE_VALUES_H
+#  include <values.h>
+# endif
 #endif 
 
 #include <utils/lsyscache.h>
index 8401e538a7f7e521f1f8ac75135ad6997b50dcac..3e3ee650f941d5867066c773446eb1ef4d381ea2 100644 (file)
@@ -9,16 +9,11 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.2 1996/10/23 07:14:43 bryanh Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.3 1997/02/14 04:15:39 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
-#ifndef WIN32
 #include <math.h>      /* for MAXFLOAT on most systems */
-#else
-#include <float.h>
-#define MAXFLOAT DBL_MAX
-#endif /* WIN32 */
 
 #include <values.h>    /* for MAXFLOAT on SunOS */
 #include <string.h>
index 1babdb7e03ff62ae085a97d273216f6e8e5c331d..66d6624f5949f757aba18efe34d32714c1158f43 100644 (file)
@@ -6,15 +6,13 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.17 1997/01/22 01:43:26 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.18 1997/02/14 04:15:49 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include <string.h>
 #include <stdio.h>
-#ifndef WIN32
 #include <pwd.h>
-#endif /*WIN32 */
 #include <sys/param.h>         /* for MAXPATHLEN */
 
 #include "postgres.h"
index 8e77d749f2aafb8ba17e01362fff532c5ea94add..605d940dc9a177afddf8786bb3be19973273ba97 100644 (file)
@@ -8,14 +8,12 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.8 1996/12/04 14:23:11 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.9 1997/02/14 04:15:59 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include <ctype.h>
-#ifndef WIN32
 #include <unistd.h>
-#endif /* WIN32 */
 #ifndef __linux__
 #include <math.h>
 #else
index 5168162d2a008a8444c73c27139fe349e4048bf4..1cb91dcaa7eac2a37fa8bd2daf5de72d58235a1a 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.39 1997/02/13 08:31:09 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.40 1997/02/14 04:16:12 momjian Exp $
  *
  * NOTES
  *
@@ -198,11 +198,7 @@ checkDataDir(const char *DataDir, bool *DataDirOK)
 
             fclose(fp);
         
-#ifndef WIN32   
             ValidatePgVersion(DataDir, &reason); 
-#else
-            reason = NULL;
-#endif /* WIN32 */
             if (reason) {
                 fprintf(stderr, 
                         "Database system in directory %s "
@@ -231,9 +227,6 @@ PostmasterMain(int argc, char *argv[])
     int         silentflag = 0;
     char        hostbuf[MAXHOSTNAMELEN];
     bool        DataDirOK;  /* We have a usable PGDATA value */
-#if defined(WIN32)
-    WSADATA WSAData;
-#endif /* WIN32 */
     
     progname = argv[0];
     
@@ -363,18 +356,6 @@ PostmasterMain(int argc, char *argv[])
     }
     
 
-#if defined(WIN32)
-    if ((status = WSAStartup(MAKEWORD(1,1), &WSAData)) == 0)
-      (void) printf("%s\nInitializing WinSock: %s\n", WSAData.szDescription, WSAData.szSystemStatus);
-    else
-    {
-      fprintf(stderr, "Error initializing WinSock: %d is the err", status);
-      exit(1);
-    }
-     _nt_init();
-     _nt_attach();
-#endif /* WIN32 */
-
     status = StreamServerPort(hostName, PostPortName, &ServerSock);
     if (status != STATUS_OK) {
         fprintf(stderr, "%s: cannot create stream port\n",
@@ -397,15 +378,12 @@ PostmasterMain(int argc, char *argv[])
         pmdaemonize();
     
     pqsignal(SIGINT, pmdie);
-#ifndef WIN32
     pqsignal(SIGCHLD, reaper);
     pqsignal(SIGTTIN, SIG_IGN);
     pqsignal(SIGTTOU, SIG_IGN);
     pqsignal(SIGHUP, pmdie);
     pqsignal(SIGTERM, pmdie);
     pqsignal(SIGCONT, dumpstatus);
-#endif /* WIN32 */
-    
 
     status = ServerLoop();
     
@@ -845,7 +823,6 @@ reaper(SIGNAL_ARGS)
     if (DebugLvl)
         fprintf(stderr, "%s: reaping dead processes...\n",
                 progname);
-#ifndef WIN32
 #ifdef HAVE_WAITPID
     while((pid = waitpid(-1, &status, WNOHANG)) > 0)
         CleanupProc(pid, status);
@@ -853,7 +830,6 @@ reaper(SIGNAL_ARGS)
     while((pid = wait3(&statusp, WNOHANG, NULL)) > 0)
         CleanupProc(pid, statusp.w_status);
 #endif
-#endif /* WIN32 */
 }
 
 /*
@@ -914,7 +890,6 @@ CleanupProc(int pid,
                                                                   * collect core dumps from all backends by hand.
                                                                   * -----------------
                                                                   */
-#ifndef WIN32
         sig = (SendStop) ? SIGSTOP : SIGUSR1;
         if (bp->pid != pid) {
             if (DebugLvl)
@@ -925,7 +900,6 @@ CleanupProc(int pid,
                         bp->pid);
             (void) kill(bp->pid, sig);
         }
-#endif /* WIN32 */
         ProcRemove(bp->pid);
         
         prev = DLGetPred(curr);
@@ -1006,7 +980,6 @@ BackendStartup(StartupInfo *packet, /* client's startup packet */
         fprintf(stderr, "-----------------------------------------\n");
     }
     
-#ifndef WIN32
     if ((pid = FORK()) == 0) {  /* child */
         if (DoExec(packet, port->sock))
             fprintf(stderr, "%s child[%d]: BackendStartup: execv failed\n",
@@ -1021,14 +994,6 @@ BackendStartup(StartupInfo *packet, /* client's startup packet */
                 progname);
         return(STATUS_ERROR);
     }
-#else
-    pid = DoExec(packet, port->sock);
-    if (pid == FALSE) {
-        fprintf(stderr, "%s: BackendStartup: CreateProcess failed\n",
-                progname);
-        return(STATUS_ERROR);
-    }
-#endif /* WIN32 */
     
     if (DebugLvl)
         fprintf(stderr, "%s: BackendStartup: pid %d user %s db %s socket %d\n",
@@ -1119,12 +1084,6 @@ DoExec(StartupInfo *packet, int portFd)
     char        dbbuf[ARGV_SIZE + 1];
     int ac = 0;
     int i;
-#if defined(WIN32)
-    char      win32_args[(2 * ARGV_SIZE) + 1];
-    PROCESS_INFORMATION piProcInfo;
-    STARTUPINFO siStartInfo;
-    BOOL fSuccess;
-#endif /* WIN32 */
 
     (void) strncpy(execbuf, Execfile, MAXPATHLEN);
     execbuf[MAXPATHLEN - 1] = '\0';
@@ -1152,16 +1111,7 @@ DoExec(StartupInfo *packet, int portFd)
     if (packet->tty[0]) {
         (void) strncpy(ttybuf, packet->tty, ARGV_SIZE);
         av[ac++] = "-o";
-#if defined(WIN32)
-     /* BIG HACK - The front end is passing "/dev/null" here which
-     ** causes new backends to fail. So, as a very special case,
-     ** use a real NT filename.
-     */
-        av[ac++] = "CON";
-#else
         av[ac++] = ttybuf;
-#endif /* WIN32 */
-
     }
 
     /* tell the backend we're using European dates */
@@ -1200,39 +1150,7 @@ DoExec(StartupInfo *packet, int portFd)
         fprintf(stderr, ")\n");
     }
     
-#ifndef WIN32
     return(execv(av[0], av));
-#else
-
-    /* Copy all the arguments into one char array */
-    win32_args[0] = '\0';
-    for (i = 0; i < ac; i++)
-    {
-      strcat(win32_args, av[i]);
-      strcat(win32_args, " ");
-    }
-
-    siStartInfo.cb = sizeof(STARTUPINFO);
-    siStartInfo.lpReserved = NULL;
-    siStartInfo.lpDesktop = NULL;
-    siStartInfo.lpTitle = NULL;
-    siStartInfo.lpReserved2 = NULL;
-    siStartInfo.cbReserved2 = 0;
-    siStartInfo.dwFlags = 0;
-
-
-     fSuccess = CreateProcess(progname, win32_args, NULL, NULL,
-               TRUE, 0, NULL, NULL, &siStartInfo, &piProcInfo);
-     if (fSuccess)
-     {
-       /* The parent process doesn't need the handles */
-       CloseHandle(piProcInfo.hThread);
-       CloseHandle(piProcInfo.hProcess);
-       return (piProcInfo.dwProcessId);
-     }
-     else
-       return (FALSE);
-#endif /* WIN32 */
 }
 
 /*
index c06f89f884f42670d7553b7e83d903889a3dfb78..7026837c34a0ef2eb18975943cf8e89347fc289b 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *    $Id: fd.c,v 1.14 1997/01/27 00:09:43 scrappy Exp $
+ *    $Id: fd.c,v 1.15 1997/02/14 04:16:26 momjian Exp $
  *
  * NOTES:
  *
@@ -134,13 +134,8 @@ static  int     nfile = 0;
  * that we can open it and find out if we really have any descriptors
  * available or not.
  */
-#ifndef WIN32
 static char *Nulldev = "/dev/null";
 static char Sep_char = '/';
-#else
-static char *Nulldev = "NUL";
-static char Sep_char = '\\';
-#endif /* WIN32 */
 
 /*
  * Private Routines
@@ -471,12 +466,7 @@ filepath(char *filename)
     char basename[16];
     int len;
 
-#ifndef WIN32    
     if (*filename != Sep_char) {
-#else
-    if (!(filename[1] == ':' && filename[2] == Sep_char)) {
-#endif /* WIN32 */      
-
         /* Either /base/ or \base\ */
         sprintf(basename, "%cbase%c", Sep_char, Sep_char);
 
@@ -576,9 +566,6 @@ fileNameOpenFile(FileName fileName,
         close(tmpfd);
     }
     
-#ifdef WIN32
-      fileFlags |= _O_BINARY;
-#endif /* WIN32 */
     vfdP->fd = open(fileName,fileFlags,fileMode);
     vfdP->fdstate = 0x0;
     
index 1da681701751918a514d156f51f70dd909323ca0..079aaaf39f863e549eb69a640ac21d1c243db119 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.10 1997/01/26 20:15:00 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.11 1997/02/14 04:16:43 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
  *     manual for POWER in any case.
  *
  */
-#ifdef WIN32
-#include <windows.h>
-#endif /* WIN32 */
-
 #include "postgres.h"
 
 #include "storage/ipc.h"
@@ -414,27 +410,3 @@ S_INIT_LOCK(slock_t *lock)
 
 
 #endif /* HAS_TEST_AND_SET */
-
-
-#ifdef WIN32
-void
-S_LOCK(HANDLE *lock)
-{
-      int x = 0;
-      x = x / x;
-}
-
-void
-S_UNLOCK(HANDLE *lock)
-{
-      int x = 0;
-      x = x / x;
-}
-
-void
-S_INIT_LOCK(HANDLE *lock)
-{
-      int x = 0;
-      x = x / x;
-}
-#endif /*WIN32*/
index 135dbc9fd40f0f3a26393196cda3465514588fef..db3b4e636b833fff24d85492e8c6aee2659335fa 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.16 1997/02/13 15:55:01 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.17 1997/02/14 04:16:56 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
  *      This is so that we can support more backends. (system-wide semaphore
  *      sets run out pretty fast.)                -ay 4/95
  *
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.16 1997/02/13 15:55:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.17 1997/02/14 04:16:56 momjian Exp $
  */
 #include <sys/time.h>
-#ifndef WIN32
 #include <unistd.h>
-#endif /* WIN32 */
 #include <string.h>
 #include <signal.h>
 #include <sys/types.h>
@@ -157,9 +155,7 @@ InitProcess(IPCKey key)
      * Routine called if deadlock timer goes off. See ProcSleep()
      * ------------------
      */
-#ifndef WIN32
     pqsignal(SIGALRM, HandleDeadLock);
-#endif /* WIN32 we'll have to figure out how to handle this later */
 
     SpinAcquire(ProcStructLock);
     
@@ -456,9 +452,7 @@ ProcSleep(PROC_QUEUE *queue,
 {
     int        i;
     PROC       *proc;
-#ifndef WIN32 /* figure this out later */
     struct itimerval timeval, dummy;
-#endif /* WIN32 */
     
     proc = (PROC *) MAKE_PTR(queue->links.prev);
     for (i=0;i<queue->size;i++)
@@ -501,13 +495,11 @@ ProcSleep(PROC_QUEUE *queue,
      * to 0.
      * --------------
      */
-#ifndef WIN32
     memset(&timeval, 0, sizeof(struct itimerval));
     timeval.it_value.tv_sec = DEADLOCK_TIMEOUT;
     
     if (setitimer(ITIMER_REAL, &timeval, &dummy))
        elog(FATAL, "ProcSleep: Unable to set timer for process wakeup");
-#endif /* WIN32 */
     
     /* --------------
      * if someone wakes us between SpinRelease and IpcSemaphoreLock,
@@ -521,13 +513,11 @@ ProcSleep(PROC_QUEUE *queue,
      * We were awoken before a timeout - now disable the timer
      * ---------------
      */
-#ifndef WIN32
     timeval.it_value.tv_sec = 0;
     
     
     if (setitimer(ITIMER_REAL, &timeval, &dummy))
        elog(FATAL, "ProcSleep: Unable to diable timer for process wakeup");
-#endif /* WIN32 */
     
     /* ----------------
      * We were assumed to be in a critical section when we went
index 3bab0bbc68770df90b4d0873887fff6ee5d37296..fdcefb78ad6fd7411476592d0eb14fc469e2d6de 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.10 1996/11/27 07:24:02 vadim Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.11 1997/02/14 04:17:08 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -154,10 +154,6 @@ mdunlink(Relation reln)
  /* On Windows NT you can't unlink a file if it is open so we have
  ** to do this.
  */
-#ifdef WIN32
-    (void) mdclose(reln);
-#endif /* WIN32 */
 
     memset(fname,0, NAMEDATALEN);
     strncpy(fname, RelationGetRelationName(reln)->data, NAMEDATALEN);
@@ -167,9 +163,6 @@ mdunlink(Relation reln)
 
     /* unlink all the overflow files for large relations */
     for (i = 1; ; i++) {
-#ifdef WIN32
-       (void) mdclose(reln);
-#endif /* WIN32 */
        sprintf(tname, "%s.%d", fname, i);
        if (FileNameUnlink(tname) < 0)
            break;
index a0b51ef327029308a77954692a95de17ec4c51d8..da904ac4f76ac39adfd427c3e2fdd682c500ee48 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.30 1997/02/12 05:24:22 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.31 1997/02/14 04:17:21 momjian Exp $
  *
  * NOTES
  *    this is the "main" module of the postgres backend and
@@ -105,13 +105,13 @@ static bool     IsEmptyQuery = false;
 
 char            relname[80];            /* current relation name */
 
-#if defined(WIN32) || defined(nextstep)
+#if defined(nextstep)
 jmp_buf    Warn_restart;
 #define sigsetjmp(x,y)  setjmp(x)
 #define siglongjmp longjmp
 #else
 sigjmp_buf Warn_restart;
-#endif /*defined(WIN32) || defined(nextstep) */
+#endif /* defined(nextstep) */
 int InWarn;
 
 extern int      NBuffers;
@@ -816,10 +816,6 @@ PostgresMain(int argc, char *argv[])
     Dlelem *curr;
     int    status;
 
-#ifdef WIN32
-    WSADATA WSAData;
-#endif /* WIN32 */
-
     extern int    optind;
     extern char   *optarg;
     extern short  DebugLvl;
@@ -830,14 +826,12 @@ PostgresMain(int argc, char *argv[])
      */
     pqsignal(SIGINT, die);
 
-#ifndef WIN32
     pqsignal(SIGHUP, die);
     pqsignal(SIGTERM, die);
     pqsignal(SIGPIPE, die);
     pqsignal(SIGUSR1, quickdie);
     pqsignal(SIGUSR2, Async_NotifyHandler);
     pqsignal(SIGFPE, FloatExceptionHandler);
-#endif /* WIN32 */
     
     /* --------------------
      *  initialize globals 
@@ -988,13 +982,6 @@ PostgresMain(int argc, char *argv[])
                */
             multiplexedBackend = true;
             serverPortnum = atoi(optarg);
-#ifdef WIN32
-           /* There was no postmaster started so the shared memory
-           ** for the shared memory table hasn't been allocated so
-           ** do it now.
-           */
-           _nt_init();
-#endif /* WIN32 */
             break;
         case 'M':
             exit(PostmasterMain(argc, argv));
@@ -1196,15 +1183,6 @@ PostgresMain(int argc, char *argv[])
         pq_init(Portfd);
     }
 
-#ifdef WIN32
-    if ((status = WSAStartup(MAKEWORD(1,1), &WSAData)) == 0)
-        (void) printf("%s\nInitializing WinSock: %s\n", WSAData.szDescription, WSAData.szSystemStatus);
-    else {
-        fprintf(stderr, "Error initializing WinSock: %d is the err", status);
-        exit(1);
-    }
-#endif /* WIN32 */
-    
     if (multiplexedBackend) {
       if (serverPortnum == 0 ||
           StreamServerPort(hostName, serverPortnum, &serverSock) != STATUS_OK)
@@ -1256,10 +1234,6 @@ PostgresMain(int argc, char *argv[])
         puts("\tInitPostgres()..");
     }
  
-#if WIN32
-     _nt_attach();
-#endif /* WIN32 */
-
     InitPostgres(DBName);
 
     /* ----------------
@@ -1274,13 +1248,9 @@ PostgresMain(int argc, char *argv[])
      * ----------------
      */
 
-#ifndef WIN32    
     pqsignal(SIGHUP, handle_warn);
 
     if (sigsetjmp(Warn_restart, 1) != 0) {
-#else
-    if (setjmp(Warn_restart) != 0) {
-#endif /* WIN32 */
         InWarn = 1;
 
         time(&tim);
@@ -1300,7 +1270,7 @@ PostgresMain(int argc, char *argv[])
      */
     if (IsUnderPostmaster == false) {
         puts("\nPOSTGRES backend interactive interface");
-        puts("$Revision: 1.30 $ $Date: 1997/02/12 05:24:22 $");
+        puts("$Revision: 1.31 $ $Date: 1997/02/14 04:17:21 $");
     }
     
     /* ----------------
@@ -1497,7 +1467,6 @@ PostgresMain(int argc, char *argv[])
   return 1;
 }
 
-#ifndef WIN32
 #ifdef HAVE_RUSAGE
 #include "rusagestub.h"
 #else /* HAVE_RUSAGE */
@@ -1597,12 +1566,3 @@ ShowUsage(void)
     PrintBufferUsage(StatFp);
 /*     DisplayTupleCount(StatFp); */
 }
-#else
-void
-ShowUsage()
-{}
-
-void
-ResetUsage()
-{}
-#endif /* WIN32 */
index 80dbae8dd0a6e027b8da3bc4c31925770ebe5f31..506b3fbfc97c2aa05346b502a434b1757e78f1b4 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.4 1996/11/10 03:03:05 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.5 1997/02/14 04:17:35 momjian Exp $
  *
  * NOTES
  *   This code is actually (almost) unused.
@@ -855,16 +855,13 @@ text *
 timeofday(void)
 {
 
-#ifndef WIN32
     struct timeval tp;
     struct timezone tpz;
-#endif /* WIN32 */
     char templ[500];
     char buf[500];
     text *tm;
     int len = 0;
 
-#ifndef WIN32
     gettimeofday(&tp, &tpz);
     (void) strftime(templ, sizeof(templ), "%a %b %d %H:%M:%S.%%d %Y %Z",
                    localtime((time_t *) &tp.tv_sec));
@@ -875,9 +872,4 @@ timeofday(void)
     VARSIZE(tm) = len;
     strncpy(VARDATA(tm), buf, strlen(buf));
     return tm;
-#else
-    len = len / len;
-    return tm;
-#endif /* WIN32 */
-
 }
index 7b5a1b8a198410217b35e3fc80eb2370d355e719..fe4e78c3f9a3e99f845a5fe7d0f687cacdf35a1b 100644 (file)
@@ -7,16 +7,14 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.5 1996/11/08 05:59:43 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.6 1997/02/14 04:17:47 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #include <string.h>
 #include <stdio.h>
-#ifndef WIN32
 #include <pwd.h>
-#endif /* WIN32 */
 
 #include <sys/param.h>
 
@@ -35,7 +33,6 @@ filename_in(char *file)
      *   should let the shell do expansions (shexpand)
      */
 
-#ifndef WIN32    
     str = (char *) palloc(MAXPATHLEN * sizeof(*str));
     str[0] = '\0';
     if (file[0] == '~') {
@@ -103,9 +100,6 @@ filename_in(char *file)
     }
     strcat(str, file+ind);
     return(str);
-#else
-    return(NULL);
-#endif /* WIN32 */
 }
 
 char *
index 6dce9642c5716b075d38e8cf63227aeadebd06e8..3c934003d195b9560c3a76bb8edf1524948371c8 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.10 1997/01/24 18:17:06 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.11 1997/02/14 04:17:52 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -220,17 +220,10 @@ char *float8out(float64   num)
     if (!num)
        return strcpy(ascii, "(null)");
 
-#ifndef WIN32
     if (isnan(*num))
        return strcpy(ascii, "NaN");
     if (isinf(*num))
        return strcpy(ascii, "Infinity");
-#else
-    if (_isnan(*num))
-       return strcpy(ascii, "NaN");
-    if (!_finite(*num))
-       return strcpy(ascii, "Infinity");
-#endif    
 
     sprintf(ascii, "%.*g", DBL_DIG, *num);
     return(ascii);
index ae4aea90f6a156dd0bfe081b9fc44ded4de7bb8d..992fd7cb0ff6918cd869c425ee55087d9929bcb7 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.11 1996/11/14 10:24:22 bryanh Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.12 1997/02/14 04:17:57 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -34,9 +34,6 @@ static int    Err_file = -1;
 static int     ElogDebugIndentLevel = 0;
 
 extern char    OutputFileName[];
-#ifdef WIN32
-extern jmp_buf  Warn_restart;
-#endif
 
 /*
  * elog --
@@ -160,12 +157,8 @@ elog(int lev, const char *fmt, ... )
         extern int InWarn;
        ProcReleaseSpins(NULL); /* get rid of spinlocks we hold */
         if (!InWarn) {
-#ifndef WIN32
            kill(getpid(), 1);  /* abort to traffic cop */
            pause();
-#else
-           longjmp(Warn_restart, 1);
-#endif /* WIN32 */
         }
        /*
         * The pause(3) is just to avoid race conditions where the
@@ -227,7 +220,6 @@ DebugFileOpen(void)
        Err_file = Debugfile = fileno(stderr);
        return(Debugfile);
     }
-#ifndef WIN32    
     /* If no filename was specified, send debugging output to stderr.
      * If stderr has been hosed, try to open a file.
      */
@@ -237,7 +229,6 @@ DebugFileOpen(void)
                 DataDir, (int)getpid());
        fd = open(OutputFileName, O_CREAT|O_APPEND|O_WRONLY, 0666);
     }
-#endif /* WIN32 */    
     if (fd < 0)
        elog(FATAL, "DebugFileOpen: could not open debugging file");
     
index 76b00525cf9ea3322b732debe5f1a65aa5c3c578..9db2d49a9f7d1d61d9c29dd2ffcccdd441297b8a 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.5 1997/02/13 09:54:04 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.6 1997/02/14 04:18:02 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -118,11 +118,7 @@ handle_load(char *filename, char *funcname)
     DynamicFileList     *file_scanner = (DynamicFileList *) NULL;
     func_ptr            retval = (func_ptr) NULL;
     char                *load_error;
-#ifdef WIN32
-    struct _stat        stat_buf;
-#else
     struct stat        stat_buf;
-#endif     /* WIN32 */
 
     /*
      * Do this because loading files may screw up the dynamic function
@@ -180,10 +176,8 @@ handle_load(char *filename, char *funcname)
        memset((char *) file_scanner, 0, sizeof(DynamicFileList));
        
         (void) strcpy(file_scanner->filename, filename);
-#ifndef WIN32
         file_scanner->device = stat_buf.st_dev;
         file_scanner->inode = stat_buf.st_ino;
-#endif /* WIN32 */
         file_scanner->next = (DynamicFileList *) NULL;
        
        file_scanner->handle = pg_dlopen(filename);
@@ -232,11 +226,7 @@ void
 load_file(char *filename)
 {
     DynamicFileList *file_scanner, *p;
-#ifdef WIN32
-    struct _stat stat_buf;
-#else
-     struct stat stat_buf;
-#endif /* WIN32 */
+    struct stat stat_buf;
 
     int done = 0;
     
index b20e6541e1a2540cd92bc4b6821acc465910c41c..b44d58e9f8e743510e401a8591477a70b4888b02 100644 (file)
@@ -6,16 +6,12 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.2 1996/11/06 10:31:52 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.3 1997/02/14 04:18:08 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include <stdio.h>
-#ifndef WIN32
 #include <grp.h>
-#else
-#include <windows.h>
-#endif /* WIN32 */
 #include <pwd.h>
 #include <string.h>
 #include <sys/stat.h>
@@ -47,7 +43,6 @@
 int
 ValidateBackend(char *path)
 {
-#ifndef WIN32
     struct stat                buf;
     uid_t              euid;
     struct group       *gp;
@@ -56,9 +51,6 @@ ValidateBackend(char *path)
     int                        is_r = 0;
     int                        is_x = 0;
     int                        in_grp = 0;
-#else
-    DWORD file_attributes;
-#endif /* WIN32 */
     
     /*
      * Ensure that the file exists and is a regular file.
@@ -73,7 +65,6 @@ ValidateBackend(char *path)
        return(-1);
     }
 
-#ifndef WIN32
     if (stat(path, &buf) < 0) {
        if (DebugLvl > 1)
            fprintf(stderr, "ValidateBackend: can't stat \"%s\"\n",
@@ -139,13 +130,6 @@ ValidateBackend(char *path)
        fprintf(stderr, "ValidateBackend: \"%s\" is not other read/execute\n",
                path);
     return(is_x ? (is_r ? 0 : -2) : -1);
-#else
-    file_attributes = GetFileAttributes(path);
-    if(file_attributes != 0xFFFFFFFF)
-      return(0);
-    else
-      return(-1);
-#endif /* WIN32 */
 }
 
 /*
@@ -163,11 +147,6 @@ FindBackend(char *backend, char *argv0)
     char       *path, *startp, *endp;
     int                pathlen;
     
-#ifdef WIN32
-    strcpy(backend, argv0);
-    return(0);
-#endif /* WIN32 */
-    
     /*
      * for the postmaster:
      * First try: use the backend that's located in the same directory
index a9639d7a74e65e37c8a904e9c46713e5ed80efdd..f24a8567fa5b20a027904fb861fdbb963b3998d4 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.3 1996/11/14 10:24:41 bryanh Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.4 1997/02/14 04:18:17 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include <sys/file.h>
 #include <stdio.h>
 #include <unistd.h>
-#ifndef WIN32
 #include <grp.h>               /* for getgrgid */
 #include <pwd.h>               /* for getpwuid */
-#endif /* WIN32 */
 
 #include "postgres.h"
 
@@ -58,9 +56,7 @@ extern char *DatabasePath;
  * Define USE_ENVIRONMENT to get PGDATA, etc. from environment variables.
  * This is the default on UNIX platforms.
  */
-#ifndef WIN32
 #define USE_ENVIRONMENT
-#endif
 
 /* ----------------------------------------------------------------
  *             some of the 19 ways to leave postgres
@@ -294,15 +290,6 @@ SetPgUserName()
     UserName = malloc(strlen(p)+1);
     strcpy(UserName, p);
 #endif /* NO_SECURITY */
-    
-#ifdef WIN32
-    /* XXX We'll figure out how to get the user name later */
-    if (UserName)
-       free(UserName);
-    UserName = malloc(strlen(p)+1);
-    strcpy(UserName, "postgres");
-#endif /* WIN32 */   
-
 }
 
 /* ----------------------------------------------------------------
index 178d45ff835517b0771b3ad9b365dcaafa06486f..9dbfcd6f11f325b0d6d4706479d9dbf8c70dfdd4 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.7 1997/01/08 08:33:07 bryanh Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.8 1997/02/14 04:18:20 momjian Exp $
  *
  * NOTES
  *      InitPostgres() is the function called from PostgresMain
@@ -135,9 +135,6 @@ InitMyDatabaseId()
     dbfname = (char *) palloc(strlen(DataDir) + strlen("pg_database") + 2);
     sprintf(dbfname, "%s%cpg_database", DataDir, SEP_CHAR);
     fileflags = O_RDONLY;
-#ifdef WIN32
-    fileflags |= _O_BINARY;
-#endif /* WIN32 */
     
     if ((dbfd = open(dbfname, O_RDONLY, 0666)) < 0)
         elog(FATAL, "Cannot open %s", dbfname);
@@ -259,11 +256,7 @@ static void
 DoChdirAndInitDatabaseNameAndPath(char *name) {
     char *reason;  
       /* Failure reason returned by some function.  NULL if no failure */
-#ifndef WIN32
     struct stat        statbuf;
-#else    
-    struct _stat statbuf;
-#endif    
     char errormsg[1000];
 
     if (stat(DataDir, &statbuf) < 0) 
index 51851fd4081dda9bb61b7dfe94bb55740414cbaf..877603f00d474574068ef1c7b138f4a3fce2a8e9 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: c.h,v 1.8 1997/02/09 04:50:25 scrappy Exp $
+ * $Id: c.h,v 1.9 1997/02/14 04:18:27 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -742,19 +742,9 @@ extern char *form(char *fmt, ...);
 #endif
 
 /* These are for things that are one way on Unix and another on NT */
-#ifndef WIN32
 #define        NULL_DEV        "/dev/null"
 #define COPY_CMD       "cp"
 #define SEP_CHAR       '/'
-#else
-#define NULL_DEV       "NUL"
-#define COPY_CMD       "copy"
-#define SEP_CHAR       '\\'
-#endif /* WIN32 */
-
-#if defined(WIN32)
-#include "port/win32/nt.h"
-#endif /* WIN32 */
 
 /* ----------------
  *     end of c.h
index a48203858cd7fba98e8f409e16395387b30ff00b..4bb37e714927f29ae7aaf6d827f7502ce3f1f603 100644 (file)
@@ -6,19 +6,13 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: libpq-fs.h,v 1.2 1996/11/06 10:30:02 scrappy Exp $
+ * $Id: libpq-fs.h,v 1.3 1997/02/14 04:18:33 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #ifndef LIBPQ_FS_H
 #define LIBPQ_FS_H
 
-
-#ifndef WIN32
-#endif /* WIN32 */
-#ifndef SEEK_SET
-#endif /* SEEK_SET */
-
 /* UNIX compatibility junk.  This should be in all systems' include files,
    but this is not always the case. */
 
index 74fb0187831d8a45536b0886c3a731103fd9d89f..011c8efb5b130eac9868692580f475f557bd1876 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: fd.h,v 1.5 1996/11/08 06:02:12 momjian Exp $
+ * $Id: fd.h,v 1.6 1997/02/14 04:18:42 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 /*
  * FileSeek uses the standard UNIX lseek(2) flags.
  */
-#ifndef WIN32
-#else
-#ifndef SEEK_SET
-#endif /* SEEK_SET */
-#endif /* WIN32 */
 
 typedef char   *FileName;
 
index db713d6524ed82c2fcc1a2b2e35014e171b8eccb..d92089491625e99df15be57caf59956393cf71d3 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: proc.h,v 1.3 1996/11/05 06:11:03 scrappy Exp $
+ * $Id: proc.h,v 1.4 1997/02/14 04:18:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #include <storage/lock.h>
 
-#ifndef WIN32
-#else
-/* This is because WIN32 already defines PROC */
-#define PROC   PGL_PROC
-#endif /* WIN32 */
-
-
 typedef struct {
   int                  sleeplock;
   int                  semNum;
index a2e8fa4027bcb0793b68cfda7fe37ae2f3a1ada6..dd346a85df90c871968d506abf65c350c38bead4 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: dynamic_loader.h,v 1.4 1996/12/28 02:12:51 momjian Exp $
+ * $Id: dynamic_loader.h,v 1.5 1997/02/14 04:18:56 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 typedef struct df_files {
     char filename[MAXPATHLEN];         /* Full pathname of file */
-#ifdef WIN32
-    _dev_t device;                     /* Device file is on */
-    _ino_t inode;                      /* Inode number of file */
-#else
     dev_t device;                      /* Device file is on */
     ino_t inode;                       /* Inode number of file */
-#endif /* WIN32 */
     void *handle;                      /* a handle for pg_dl* functions */
     struct df_files *next;
 } DynamicFileList;
index 84fcd34a8903d66fba74e4c1277e06a0fce8df12..47ef5684f6a17ce027a5a8008adbbe8e53ddd64d 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.3 1996/11/26 01:17:56 bryanh Exp $
+ *    $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.4 1997/02/14 04:19:07 momjian Exp $
  *
  * NOTES
  *     XXX eventually, should be able to handle version identifiers
@@ -63,11 +63,8 @@ ValidatePgVersion(const char *path, char **reason_p) {
     int         fd;
     char version[4];
     char full_path[MAXPGPATH+1];
-#ifndef WIN32
     struct stat        statbuf;
-#else    
-    struct _stat statbuf;
-#endif    
+
     PathSetVersionFilePath(path, full_path);
     
     if (stat(full_path, &statbuf) < 0) {