aboutsummaryrefslogtreecommitdiffstats
path: root/pc
diff options
context:
space:
mode:
Diffstat (limited to 'pc')
-rw-r--r--pc/ChangeLog22
-rw-r--r--pc/Makefile190
-rw-r--r--pc/config.h48
-rw-r--r--pc/dlfcn.c84
-rw-r--r--pc/dlfcn.h41
-rw-r--r--pc/gawkmisc.pc36
-rw-r--r--pc/getid.c37
-rw-r--r--pc/include/fcntl.h3
-rw-r--r--pc/include/process.h3
-rw-r--r--pc/include/stdio.h3
-rw-r--r--pc/include/stdlib.h3
-rw-r--r--pc/include/string.h3
-rw-r--r--pc/include/sys/stat.h3
-rw-r--r--pc/include/sys/types.h3
-rw-r--r--pc/include/time.h3
-rw-r--r--pc/popen.c37
-rw-r--r--pc/popen.h26
17 files changed, 103 insertions, 442 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 9da36a16..bcccabfe 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,25 @@
+Sat Dec 18 20:13:35 2010 Eli Zaretskii <eliz@gnu.org>
+
+ * popen.h: Remove the parts conditioned by _MSC_VER and OS2. Use
+ __DJGPP__ instead of __GO32__.
+
+ * popen.c (popen, pclose) [OS2, _MSC_VER]: Remove definitions.
+ (unixshell, scriptify, os_pclose): Remove OS2 parts.
+
+ * getid.c: Remove the parts conditioned by _MSC_VER and OS2.
+
+ * config.h: Remove the parts conditioned by _MSC_VER.
+
+ * Makefile: Drop support for DJGPP v1.x and for Microsoft
+ compilers on DOS/Windows.
+
+ * gawkmisc.pc (setenv, unsetenv) [__MINGW32__]: Emulations for MinGW.
+
+ * Makefile (DLMINGW32): New variable.
+ (mingw32): Pass it to sub-Make.
+
+ * dlfnc.h, dlfcn.c, include/*: Removed.
+
Mon Nov 29 20:10:00 2010 Eli Zaretskii <eliz@gnu.org>
* config.h (HAVE_STRFTIME): Don't define for __MINGW32__. Define
diff --git a/pc/Makefile b/pc/Makefile
index 33afe284..4e0511a7 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -1,35 +1,34 @@
-# Makefile for gawk (GNU awk) Dec 2000
+# Makefile for gawk (GNU awk) Dec 2010
#
-# - for GNU C (djgpp) [32bit executable for DOS]
+# - for GNU C (djgpp) [32bit protected-mode executable for DOS]
# - for GNU C (emx) [32bit executable for OS/2 or DOS or Windows32]
-# - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT]
-# - for MS-Visual C/C++ 4.x [Windows32 executable for Windows 9x/NT]
-# - for Microsoft C 7 [16bit ececutable for DOS]
-# - for Microsoft C 6.00A [16bit executable for OS/2 or DOS]
+# - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT/2K/XP/7]
-# Tested with GNU make and dmake-3.8 under OS/2 and DOS, and ndmake and
-# Microsoft nmake under DOS. Compiling with dmake under DOS may require the
-# DOS-only version of dmake (so that swapping works). nmake requires a
-# few edits in the configuration section below.
+# Tested with GNU make on Windows, OS/2 and DOS.
default:
@echo "Enter $(MAK) target "
- @echo " where 'target' is chosen from "
+ @echo " where 'target' is chosen from "
@echo " djgpp ... DOS 32-bit exe [GNU C, Delorie, v2] "
- @echo " djgppv1 . DOS 32-bit exe [GNU C, Delorie, v1] "
@echo " emx ..... OS/2 32-bit exe [emx/gcc; uses emxlibc.dll] "
@echo " emxnt ... NT exe [emx/gcc with RSXNT] "
@echo " emxbnd .. OS/2 and DOS 32-bit exe [emx/gcc] "
@echo " mingw32 . Windows32 exe [Mingw32 GNU C] "
- @echo " msc ..... DOS exe [Microsoft C 7 & 8 (AKA 1.52)] "
- @echo " msc6 .... DOS exe [Microsoft C 6.00a] "
- @echo " msc6os2 . OS/2 exe [Microsoft C 6.00a] "
- @echo " msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a] "
- @echo " vcWin32 . Windows32 exe [Microsoft Visual C] "
@echo " ----------------------------------------------------- "
@echo " test .... Perform tests (see README_d/README.pc) "
@echo " install . Install gawk under $(prefix)/ "
+# Support dropped in 4.0
+# - for DJGPP v1.x [DOS 32bit protected-mode executable]
+# - for MS-Visual C/C++ 4.x [Windows32 executable for Windows 9x/NT]
+# - for Microsoft C 7 [16bit ececutable for DOS]
+# - for Microsoft C 6.00A [16bit executable for OS/2 or DOS]
+# @echo " djgppv1 . DOS 32-bit exe [GNU C, Delorie, v1] "
+# @echo " msc ..... DOS exe [Microsoft C 7 & 8 (AKA 1.52)] "
+# @echo " msc6 .... DOS exe [Microsoft C 6.00a] "
+# @echo " msc6os2 . OS/2 exe [Microsoft C 6.00a] "
+# @echo " msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a] "
+# @echo " vcWin32 . Windows32 exe [Microsoft Visual C] "
# Support dropped in 3.0
# - for Microsoft C 5.1 [16bit executable for OS/2 or DOS]
# @echo " msc51 DOS exe [Microsoft C 5.1] "
@@ -46,14 +45,6 @@ DRSPFILE = dgawk.rsp
#LDRSP = $(GAWKOBJS)
#LNKRSP = $(LDRSP)
#
-# else if make == dmake
-# Response files for linker: dmake allows the macro expansion
-# $(macro_name:modifier_list:modifier_list:...)
-# The macro mktmp creates a temporary file for the linker.
-# The 't' modifier is for tokenization.
-#LDRSP = @$(mktmp $(<:t"\n"))
-#LNKRSP = @$(mktmp $(<:t"+\n") ) # Space before final paren req
-#
# else use brain-dead approach (emxbnd will need 'tr').
RSP = $(RSPFILE)
PRSP = $(PRSPFILE)
@@ -83,27 +74,13 @@ pkgdatadir = $(prefix)/lib/awk
install = 1
#------------------------------------------------------------------------
# To work around command-line length problems, this makefile assumes
-# that $($X) can be expanded. If using a make (such as nmake) which
-# cannot handle such macros, define DO_LNK and DO_BIND for your target
-# as $(L<target>) and $(B<target>), resp.; e.g.,
-#DO_LNK = $(LvcWin32)
-#DO_PLNK = $(PLvcWin32)
-# and then comment the following:
+# that $($X) can be expanded.
DO_LNK = $($(LNK))
DO_BIND= $($(BIND))
DO_PLNK = $($(PLNK))
DO_PBIND= $($(PBIND))
DO_DLNK = $($(DLNK))
DO_DBIND= $($(DBIND))
-#------------------------------------------------------------------------
-# For dynamic extension support, uncomment these lines
-# pick the appropriate .def file entry for your compiler
-#DYN_FLAGS=-DDYNAMIC
-#DYN_EXP=gawk.exp
-#DYN_OBJ=dlfcn$O $(DYN_EXP)
-#DYN_MAKEXP=$(DMEvcWin32)
-#DYN_MAKEXP=$(DMEmingw32)
-#
#========================================================================
# End of general configuration. Some platform-specific configuration
# notes appear below.
@@ -133,16 +110,6 @@ djgpp-debug:
LNK=LDJG PLNK=PLDJG DLNK=DLDJG LF2=-lm \
BIND=BDJG PBIND='' DBIND=''
-LDJGv1 = $(CC) $(LF) -o gawk $(LDRSP) $(LF2)
-#BDJGv1 = coff2exe -s /djgpp/bin/go32.exe gawk
-BDJGv1 = coff2exe gawk
-
-djgppv1:
- $(MAK) all \
- CC=gcc O=.o CF=-O \
- LNK=LDJGv1 LF=-s LF2=-lm \
- BIND=BDJGv1
-
#========================================================================
#========================== EMX =========================================
#========================================================================
@@ -187,132 +154,17 @@ emxbnd-debug:
#========================== MINGW32 =====================================
#========================================================================
-DMEmingw32 = dlltool -D gawk.exe -d gawkw32.def -e gawk.exp -l libgawk.a
-
LMINGW32 = $(CC) $(LF) -o $@ $(GAWKOBJS) $(LF2)
PLMINGW32 = $(CC) $(LF) -o $@ $(PGAWKOBJS) $(LF2)
+DLMINGW32 = $(CC) $(LF) -o $@ $(DGAWKOBJS) $(LF2)
# The following might work around command-line length limitations:
#LMINGW32 = $(CC) $(LF) -o $@ *.o $(LF2)
mingw32:
$(MAK) all \
CC=gcc O=.o CF="-O2 -gdwarf-2 -g3" OBJ=popen.o \
- LNK=LMINGW32 PLNK=PLMINGW32 LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP=
-
-#========================================================================
-#========================== MSC =========================================
-#========================================================================
-
-# stdargv, glob, and director are from Stewartson's sh. These provide
-# globbing and enhanced argument-passing. MSC setargv.obj is a
-# more limited alternative (and it will permit a bound version).
-#STDARGV = stdargv.obj glob.obj director.obj
-STDARGV = setargv.obj
-
-# Optimization and library options:
-# Os == optimize for size, Ot == optimize for speed, G2 == 286 or better
-#MSCOPT = -Gt3600 -Os -G2
-# MSC seems to be more stable with -Od than with -Ot, but then regexec.c gives
-# "code segment too large" error when compiling. Adding -G2y fixes this and
-# lets us keep the -Od.
-MSCOPT = -Gt3600 -Od -G2y
-# Alternate lib, does not use math coprocessor.
-#MSCLIB = llibca
-#MSCCL = -FPa
-# Emulator lib, uses math coprocessor if present.
-MSCLIB = llibce
-MSCCL = -FPi
-#MSCCL = -FPc
-
-# If the stack gets much smaller than 3000, the "longwrds" test fails.
-LMSC = link $(LF) $(LNKRSP) $(STDARGV)/NOE,$@,,/NOD:llibce $(MSCLIB)$(LF2)/STACK:0x2eb0,nul
-
-
-# CLMSC-linking works when building under OS/2
-CLMSC = $(CC) -o $@ $(LF) $(GAWKOBJS) $(STDARGV) $(LF2) -link /NOE/NOI/STACK:0x6f00
-
-BMSC = bind $@ /n DOSMAKEPIPE DOSCWAIT
-
-
-# Ugly hack: config.h defines __STDC__ if not defined on command-line.
-# OS/2 versions can't use -Za in getid.c. MSC7 uses stub headers in pc/
-# due to ANSI conflicts. MSC 5.1 defines __STDC__=0 regardless of ANSI flag.
-
-# dmake-3.8 runs out of memory under DOS. Request that dmake
-# swap itself out on these targets. Note that this won't have
-# any affect on the bound OS/2 and DOS version of dmake-3.8.
-
-.SWAP: msc msc-debug msc6 msc6os2 msc6bnd msc51 check
-
-msc:
- $(MAK) all \
- "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Ze -Ipc/include $(MSCOPT)" \
- OBJ=popen.obj \
- LNK=LMSC P=+
-Lmsc = $(LMSC) # for broken makes (nmake) which cannot expand $($X)
-Bmsc =
-
-msc-debug:
- $(MAK) all \
- "CC=cl $(MSCCL)" O=.obj "CF=-AL -Ze -Ipc/include -W2 -Zi -Od" \
- OBJ=popen.obj \
- LNK=LMSC LF2=/CO P=+
-
-msc6:
-# $(MAK) builtin.obj \
-# "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Za $(MSCOPT) -Od"
- $(MAK) all \
- "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Za $(MSCOPT)" \
- OBJ=popen.obj \
- LNK=LMSC P=+
-Lmsc6 = $(LMSC) # for broken makes (nmake) which cannot expand $($X)
-Bmsc6 =
-
-msc6os2:
-# $(MAK) builtin.obj \
-# "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -DOS2 -UMSDOS $(MSCOPT) -Od"
- $(MAK) all \
- "CC=cl $(MSCCL)" O=.obj "CF=-AL -DOS2 -UMSDOS $(MSCOPT)" \
- LNK=LMSC "LF2=p,gawk.def" P=+
-
-msc6bnd:
-# $(MAK) builtin.obj \
-# "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -DOS2 $(MSCOPT) -Od"
- $(MAK) all \
- "CC=cl $(MSCCL)" O=.obj "CF=-AL -DOS2 $(MSCOPT)" \
- OBJ=popen.obj \
- LNK=LMSC "LF2=p,gawk.def" P=+ \
- BIND=BMSC
-Lmsc6bnd = $(LMSC) # for broken makes (nmake) which cannot expand $($X)
-Bmsc6bnd = $(BMSC)
-
-
-# Windows '9x / NT
-DMEvcWin32 = lib /def:gawkw32.def /name:gawk.exe /out:gawk.lib
-LvcWin32 = link -nologo -subsystem:console -release -out:$@ $(LNKRSP)
-PLvcWin32 = link -nologo -subsystem:console -release -out:$@ $(PLDRSP)
-
-vcWin32:
- $(MAK) all \
- "CC=cl -nologo" O=.obj "CF=-o2 -DWIN32 -D__STDC__=0" \
- OBJ=popen.obj \
- LNK=LvcWin32
-
-
-# Support dropped in 3.0
-#msc51:
-# $(MAK) all \
-# "CC=cl $(MSCCL)" O=.obj "CF=-AL -Za -D_MSC_VER=510 $(MSCOPT)" \
-# OBJ=popen.obj \
-# LNK=LMSC P=+
-#
-#msc51bnd:
-# $(MAK) all \
-# "CC=cl -AL ($MSCCL)" O=.obj "CF=-DOS2 -D_MSC_VER=510 $(MSCOPT)" \
-# OBJ=popen.obj \
-# LNK=CLMSC "LF=-Lp -Fb" "LF2=gawk.def"
-
-#========================================================================
+ LNK=LMINGW32 PLNK=PLMINGW32 DLNK=DLMINGW32 \
+ LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP=
# Define BIND for BINDless compiles, otherwise $($(BIND)) may break.
BIND = EMPTY
@@ -408,7 +260,7 @@ alloca$O: alloca.c
install: install$(install)
-install1:
+install1:
echo extproc sh $(prefix)/bin/igawk.cmd > igawk.cmd
echo shift >> igawk.cmd
cat pc/awklib/igawk >> igawk.cmd
diff --git a/pc/config.h b/pc/config.h
index 76250eac..04ab519d 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -166,11 +166,6 @@
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1
-/* Define as __inline if that's what the C compiler calls it. */
-#if defined (_MSC_VER)
-#define inline
-#endif
-
#ifdef __GNUC__
#define inline __inline__
/* Define to 1 if you have the <stddef.h> header file. */
@@ -474,7 +469,7 @@
/* #undef HAVE_CATGETS */
/* The size of `unsigned int' & `unsigned long', as computed by sizeof. */
-#if defined(DJGPP) || defined(_MSC_VER) || defined(__MINGW32__)
+#if defined(DJGPP) || defined(__MINGW32__)
# include <limits.h>
#endif
@@ -497,32 +492,9 @@
# define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk"
#endif
-#if defined (_MSC_VER)
-#if !defined(__STDC__)
-# define __STDC__ 1
-#endif
-#undef HAVE_UNISTD_H
-#undef HAVE_SYS_PARAM_H
-#undef HAVE_RANDOM
-/* msc strftime is incomplete, use supplied version */
-#undef HAVE_STRFTIME
-/* #define HAVE_TM_ZONE */
-#define altzone timezone
-#endif
-
#define HAVE_POPEN_H 1
-#if defined(_MSC_VER) && defined(MSDOS)
-#define system(s) os_system(s)
-#endif
-
-#ifdef _MSC_VER
-#define ssize_t long int /* DJGPP has ssize_t */
-#define intmax_t long
-#define uintmax_t unsigned long
-#endif
-
-#if defined (_MSC_VER) || defined(__EMX__)
+#if defined(__EMX__)
#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif
@@ -542,26 +514,14 @@
#include <crtrsxnt.h>
#endif
-/* For vcWin32 */
-#if defined(WIN32) && defined(_MSC_VER)
-#define alloca _alloca
-#define system(s) os_system(s)
-/* VC++ dosen't supprt restrict keyword */
-#define restrict
-/* VC++ have tmpfile */
-#define HAVE_TMPFILE
-/* sys/time.h is not exist in VC++? */
-#undef TIME_WITH_SYS_TIME
-#endif
-
#if defined(__MINGW32__)
#undef HAVE_SYS_PARAM_H
#endif
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#if defined(__MINGW32__)
# define WEXITSTATUS(stat_val) ((stat_val) & ~0xC0000000)
#endif
-
+
#ifdef __MINGW32__
#define HAVE_USLEEP 1
#endif
diff --git a/pc/dlfcn.c b/pc/dlfcn.c
deleted file mode 100644
index f2394c63..00000000
--- a/pc/dlfcn.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-** dlfcn.c -- limited implementation of posix dynamic loading functions
-*/
-
-/*
- * Copyright (C) 2003 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include <dlfcn.h>
-#include <errno.h>
-#include <windows.h>
-
-/* open the library file. We currently ignore flags. */
-void *dlopen(const char * libname, int flags)
-{
- HMODULE libH;
-
-
- /* if libname is specified, we need to load a library of that name */
- if (libname) {
- libH = LoadLibrary(libname);
- }
-
- /* otherwise, we're supposed to return a handle to global symbol
- * information, which includes the executable and all libraries loaded
- * with RTLD_GLOBAL. For our purposes, it doesn't really matter, so
- * we simply return the handle to the .exe */
- else {
- libH = GetModuleHandle(NULL);
- }
-
- return (void *)libH;
-}
-
-
-/* don't need the library any more */
-int dlclose(void * libH)
-{
- int rc;
-
- if (FreeLibrary((HMODULE)libH)) {
- rc = 0;
- }
- else {
- rc = -1;
- }
-
- return rc;
-}
-
-/* find the symbol */
-void *dlsym(void * /*restrict*/ libH, const char * /*restrict*/ fnName)
-{
- return (void *)GetProcAddress((HMODULE)libH, fnName);
-}
-
-char *dlerror(void)
-{
- static char errbuf[1024];
-
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errbuf, sizeof(errbuf), NULL);
-
- return errbuf;
-}
-
-
diff --git a/pc/dlfcn.h b/pc/dlfcn.h
deleted file mode 100644
index bb7366bc..00000000
--- a/pc/dlfcn.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-** dlfcn.h -- limited implementation of posix dynamic loading functions
-*/
-
-/*
- * Copyright (C) 2003 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef _DLFCN_H
-#define _DLFCN_H
-
-/* symbols required by susv3. These are not supported here (everything is
- * RTLD_NOW, RTLD_GLOBAL) */
-#define RTLD_LAZY 0
-#define RTLD_NOW 1
-#define RTLD_GLOBAL 0
-#define RTLD_LOCAL 2
-
-int dlclose(void *);
-char *dlerror(void);
-void *dlopen(const char *, int);
-void *dlsym(void * /*restrict*/, const char * /*restrict*/);
-
-#endif
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 1355449c..0fd3a8f4 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -461,3 +461,39 @@ _os2_unixroot_path(const char *path)
return (result) ? (const char*) result : path;
}
#endif /* __EMX__ */
+
+#ifdef __MINGW32__
+
+extern void *xmalloc (size_t);
+
+int
+setenv (const char *name, const char *value, int rewrite)
+{
+ char *entry;
+
+ if (*value == '=')
+ ++value;
+
+ if (getenv (name) && !rewrite)
+ return 0;
+
+ entry = xmalloc (strlen (name) + 1 + strlen (value) + 1);
+ strcat (strcat (strcpy (entry, name), "="), value);
+ if (putenv (entry) != 0)
+ {
+ free (entry);
+ return -1;
+ }
+ return 0;
+}
+
+int
+unsetenv (const char *name)
+{
+ if (!name || !*name || strchr (name, '=') != NULL)
+ return -1;
+
+ return setenv (name, "", 1);
+}
+
+#endif /* __MINGW32__ */
diff --git a/pc/getid.c b/pc/getid.c
index 82cfd6cb..eb30ae44 100644
--- a/pc/getid.c
+++ b/pc/getid.c
@@ -1,24 +1,6 @@
-#if defined(_MSC_VER) || defined(__MINGW32__)
-
-#ifdef OS2
-# define INCL_DOSPROCESS
-# include <os2.h>
-# if _MSC_VER == 510
-# define DosGetPID DosGetPid
-# endif
-#else
-# include <process.h>
-#endif
-
-#ifdef OS2
-int getpid(void)
-{
- PIDINFO PidInfo;
+#ifdef __MINGW32__
- DosGetPID(&PidInfo);
- return(PidInfo.pid);
-}
-#endif
+#include <process.h>
unsigned int getuid (void)
{
@@ -40,23 +22,16 @@ unsigned int getegid (void)
return (0);
}
-#endif
+#endif /* __MINGW32__ */
int getpgrp(void)
{
return (0);
}
-#if defined(_MSC_VER) || defined(__GO32__) || defined(__MINGW32__)
+#if defined(__DJGPP__) || defined(__MINGW32__)
int getppid(void)
{
-#ifdef OS2
- PIDINFO PidInfo;
-
- DosGetPID(&PidInfo);
- return(PidInfo.pidParent);
-#else
- return(0);
-#endif
+ return (0);
}
-#endif
+#endif /* __DJGPP__ || __MINGW32__ */
diff --git a/pc/include/fcntl.h b/pc/include/fcntl.h
deleted file mode 100644
index 5ebc7a6b..00000000
--- a/pc/include/fcntl.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __STDC__
-#include <fcntl.h>
-#define __STDC__ 1
diff --git a/pc/include/process.h b/pc/include/process.h
deleted file mode 100644
index f511d5f7..00000000
--- a/pc/include/process.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __STDC__
-#include <process.h>
-#define __STDC__ 1
diff --git a/pc/include/stdio.h b/pc/include/stdio.h
deleted file mode 100644
index 25fb7c97..00000000
--- a/pc/include/stdio.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __STDC__
-#include <stdio.h>
-#define __STDC__ 1
diff --git a/pc/include/stdlib.h b/pc/include/stdlib.h
deleted file mode 100644
index 0789b242..00000000
--- a/pc/include/stdlib.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __STDC__
-#include <stdlib.h>
-#define __STDC__ 1
diff --git a/pc/include/string.h b/pc/include/string.h
deleted file mode 100644
index 48e942fa..00000000
--- a/pc/include/string.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __STDC__
-#include <string.h>
-#define __STDC__ 1
diff --git a/pc/include/sys/stat.h b/pc/include/sys/stat.h
deleted file mode 100644
index 904d056e..00000000
--- a/pc/include/sys/stat.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __STDC__
-#include <sys/stat.h>
-#define __STDC__ 1
diff --git a/pc/include/sys/types.h b/pc/include/sys/types.h
deleted file mode 100644
index b942dda8..00000000
--- a/pc/include/sys/types.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __STDC__
-#include <sys/types.h>
-#define __STDC__ 1
diff --git a/pc/include/time.h b/pc/include/time.h
deleted file mode 100644
index b4a9ea3f..00000000
--- a/pc/include/time.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __STDC__
-#include <time.h>
-#define __STDC__ 1
diff --git a/pc/popen.c b/pc/popen.c
index 3410e2ca..d8b18558 100644
--- a/pc/popen.c
+++ b/pc/popen.c
@@ -4,18 +4,6 @@
#include <string.h>
#include <process.h>
-#ifdef OS2
-#ifdef _MSC_VER
-#define popen(c,m) _popen(c,m)
-#define pclose(f) _pclose(f)
-#endif
-#endif
-
-#if defined(WIN32) && defined(_MSC_VER)
-#define popen _popen
-#define pclose _pclose
-#endif
-
#ifndef _NFILE
#define _NFILE 40
#endif
@@ -36,7 +24,7 @@ static struct {
* Currently, only MSC (running under DOS) and MINGW versions are managed.
*/
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#if defined(__MINGW32__)
static int
unixshell(char *p)
@@ -131,11 +119,6 @@ os_system(const char *cmd)
int i;
char *cmd1;
-#if defined(OS2)
- if (_osmode == OS2_MODE)
- return(system(cmd));
-#endif
-
if ((cmd1 = scriptify(cmd)) == NULL) return(1);
if (s = getenv("SHELL"))
i = spawnlp(P_WAIT, s, s, cmd1 + strlen(s), NULL);
@@ -144,7 +127,7 @@ os_system(const char *cmd)
unlink_and_free(cmd1);
return(i);
}
-#else
+#else /* !__MINGW32__ */
#define os_system(cmd) system(cmd)
#endif
@@ -156,20 +139,15 @@ os_popen(const char *command, char *mode )
char *name;
int cur;
char curmode[4];
-#if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32))
+#if defined(__MINGW32__)
char *cmd;
#endif
-
-#if defined(OS2) && (_MSC_VER != 510)
- if (_osmode == OS2_MODE)
- return(popen(command, mode));
-#endif
if (*mode != 'r' && *mode != 'w')
return NULL;
strncpy(curmode, mode, 3); curmode[3] = '\0';
-#if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32))
+#if defined(__MINGW32__)
current = popen(cmd = scriptify(command), mode);
cur = fileno(current);
strcpy(pipes[cur].pmode, curmode);
@@ -217,12 +195,7 @@ os_pclose( FILE * current)
int cur = fileno(current);
int fd, rval;
-#if defined(OS2) && (_MSC_VER != 510)
- if (_osmode == OS2_MODE)
- return(pclose(current));
-#endif
-
-#if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32))
+#if defined(__MINGW32__)
rval = pclose(current);
*pipes[cur].pmode = '\0';
unlink_and_free(pipes[cur].command);
diff --git a/pc/popen.h b/pc/popen.h
index 0ec5756b..99f00169 100644
--- a/pc/popen.h
+++ b/pc/popen.h
@@ -1,21 +1,13 @@
/*
** popen.h -- prototypes for pipe functions
*/
-
-#if defined (OS2) && !defined(MSDOS) /* OS/2, but not family mode */
-# if defined (_MSC_VER)
-# define popen(c, m) _popen(c, m)
-# define pclose(f) _pclose(f)
+#if !defined (__DJGPP__)
+# if defined (popen)
+# undef popen
+# undef pclose
# endif
-#else
-# if !defined (__GO32__)
-# if defined (popen)
-# undef popen
-# undef pclose
-# endif
-# define popen(c, m) os_popen(c, m)
-# define pclose(f) os_pclose(f)
- extern FILE *os_popen( const char *, const char * );
- extern int os_pclose( FILE * );
-# endif
-#endif
+# define popen(c, m) os_popen(c, m)
+# define pclose(f) os_pclose(f)
+ extern FILE *os_popen( const char *, const char * );
+ extern int os_pclose( FILE * );
+#endif /* !__DJGPP__ */