Remove old windows support

This commit is contained in:
chase
2018-08-18 15:57:09 -05:00
committed by Jon Trulson
parent 1610ff3415
commit d12ad886c1
21 changed files with 14 additions and 932 deletions

View File

@@ -50,16 +50,3 @@ clean:
$(RM) -r Makefile.proto Makefile Makefile.dep bootstrap .depend
depend:
imake.exe::
@echo making imake with BOOTSTRAPCFLAGS=-DWIN32
imake.exe:: imake.obj
cl -nologo imake.obj libc.lib kernel32.lib
imake.obj: imake.c
cl -nologo -W2 -D__STDC__ -c -DWIN32 $(CFLAGS) imake.c
clean.Win32:
if exist imake.exe del imake.exe
if exist imake.obj del imake.obj

View File

@@ -161,9 +161,6 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h>
#include <ctype.h>
#include "Xosdefs.h"
#ifdef WIN32
# include "Xw32defs.h"
#endif
#ifndef X_NOT_POSIX
# ifndef _POSIX_SOURCE
# define _POSIX_SOURCE
@@ -172,9 +169,7 @@ in this Software without prior written authorization from The Open Group.
#include <sys/types.h>
#include <fcntl.h>
#ifdef X_NOT_POSIX
# ifndef WIN32
# include <sys/file.h>
# endif
# include <sys/file.h>
#else
# include <unistd.h>
#endif
@@ -203,15 +198,10 @@ typedef int waitType;
# define waitSig(w) ((w) & 0xff)
typedef int waitType;
# else /* SYSV */
# ifdef WIN32
# include <process.h>
typedef int waitType;
# else
# include <sys/wait.h>
# define waitCode(w) ((w).w_T.w_Retcode)
# define waitSig(w) ((w).w_T.w_Termsig)
typedef union wait waitType;
# endif
# endif
# ifndef WIFSIGNALED
# define WIFSIGNALED(w) waitSig(w)
@@ -233,11 +223,7 @@ extern char *getenv();
#ifdef X_NOT_STDC_ENV
extern int errno;
#endif
#ifndef WIN32
#include <sys/utsname.h>
#else
#include <windows.h>
#endif
#ifndef SYS_NMLN
# ifdef _SYS_NMLN
# define SYS_NMLN _SYS_NMLN
@@ -316,13 +302,7 @@ static char *cpp = NULL;
static char *tmpMakefile = "/tmp/Imf.XXXXXX";
static char *tmpImakefile = "/tmp/IIf.XXXXXX";
static char *make_argv[ ARGUMENTS ] = {
#ifdef WIN32
"nmake"
#else
"make"
#endif
};
static char *make_argv[ ARGUMENTS ] = {"make"};
static int make_argindex;
static int cpp_argindex;
@@ -727,15 +707,6 @@ doit(FILE *outfd, const char *cmd, char **argv)
/*
* Fork and exec the command.
*/
#ifdef WIN32
if (outfd)
dup2(fileno(outfd), 1);
status = _spawnvp(_P_WAIT, cmd, argv);
if (status < 0)
LogFatal("Cannot spawn %s.", cmd);
if (status > 0)
LogFatal("Exit code %d.", status);
#else
pid = fork();
if (pid < 0)
LogFatal("Cannot fork.");
@@ -756,11 +727,8 @@ doit(FILE *outfd, const char *cmd, char **argv)
execvp(cmd, argv);
LogFatal("Cannot exec %s.", cmd);
}
#endif
}
#ifndef WIN32
#if (defined(DEFAULT_OS_NAME) || defined(DEFAULT_OS_MAJOR_REV) || \
defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV))
static void
@@ -828,13 +796,12 @@ parse_utsname(struct utsname *name, const char *fmt, char *result, const char *m
int ret = sscanf(buf, fmt + arg + 1, result);
(void) ret;
}
#endif
/* Trim leading 0's and periods from version names. The 0's cause
the number to be interpreted as octal numbers. Some version strings
have the potential for different numbers of .'s in them.
*/
#if (defined(DEFAULT_OS_MAJOR_REV) || defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV))
static const char *
trim_version(const char *p)
@@ -1240,7 +1207,6 @@ get_gcc_incdir(FILE *inFile)
static boolean
define_os_defaults(FILE *inFile)
{
#ifndef WIN32
#if (defined(DEFAULT_OS_NAME) || defined(DEFAULT_OS_MAJOR_REV) || \
defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV))
struct utsname name;
@@ -1287,22 +1253,6 @@ define_os_defaults(FILE *inFile)
#if defined (sun) && defined(SVR4)
get_sun_compiler_versions (inFile);
#endif
#else /* WIN32 */
OSVERSIONINFO osvi;
static char* os_names[] = { "Win32s", "Windows 95", "Windows NT" };
memset(&osvi, 0, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
GetVersionEx (&osvi);
fprintf (inFile, "#define DefaultOSName Microsoft %s\n",
os_names[osvi.dwPlatformId]);
fprintf(inFile, "#define DefaultOSMajorVersion %d\n", osvi.dwMajorVersion);
fprintf(inFile, "#define DefaultOSMinorVersion %d\n", osvi.dwMinorVersion);
fprintf(inFile, "#define DefaultOSTeenyVersion %d\n",
osvi.dwBuildNumber & 0xFFFF);
#endif /* WIN32 */
return FALSE;
}
@@ -1539,9 +1489,6 @@ ReadLine(FILE *tmpfd, const char *tmpfname)
char *p1, *p2;
if (! initialized) {
#ifdef WIN32
FILE *fp = tmpfd;
#endif
int total_red;
struct stat st;
@@ -1558,12 +1505,8 @@ ReadLine(FILE *tmpfd, const char *tmpfname)
end = buf + total_red;
*end = '\0';
fseek(tmpfd, 0, 0);
#if defined(SYSV) || defined(WIN32)
#if defined(SYSV)
tmpfd = freopen(tmpfname, "w+", tmpfd);
#ifdef WIN32
if (! tmpfd) /* if failed try again */
tmpfd = freopen(tmpfname, "w+", fp);
#endif
if (! tmpfd)
LogFatal("cannot reopen %s.", tmpfname);
#else /* !SYSV */
@@ -1587,10 +1530,6 @@ ReadLine(FILE *tmpfd, const char *tmpfname)
break;
}
else if (*p1 == '\n') { /* real EOL */
#ifdef WIN32
if (p1 > pline && p1[-1] == '\r')
p1[-1] = '\0';
#endif
*p1++ = '\0';
break;
}
@@ -1653,9 +1592,6 @@ KludgeOutputLine(char **pline)
if (quotechar) {
if (quotechar == '\\' ||
(*p == quotechar &&
# ifdef WIN32
quotechar != ')' &&
# endif
p[-1] != '\\'))
quotechar = '\0';
continue;

View File

@@ -99,10 +99,10 @@ in this Software without prior written authorization from The Open Group.
#ifdef Mips
# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
# define imake_ccflags "-DBSD43"
# else
# else
# define imake_ccflags "-DSYSV"
# endif
#endif
#endif
#ifdef is68k
#define imake_ccflags "-Dluna -Duniosb"
@@ -132,14 +132,6 @@ in this Software without prior written authorization from The Open Group.
#define imake_ccflags "-fn -tm c1"
#endif
#ifdef WIN32
#if _MSC_VER < 1000
#define imake_ccflags "-nologo -batch -D__STDC__"
#else
#define imake_ccflags "-nologo -D__STDC__"
#endif
#endif
#ifdef __sxg__
#define imake_ccflags "-DSYSV -DUSG -DNOSTDHDRS"
#endif
@@ -207,14 +199,9 @@ in this Software without prior written authorization from The Open Group.
* all colons). One way to tell if you need this is to see whether or not
* your Makefiles have no tabs in them and lots of @@ strings.
*/
#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(__llvm__)
#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(__llvm__)
#define FIXUP_CPP_WHITESPACE
#endif
#ifdef WIN32
#define REMOVE_CPP_LEADSPACE
#define INLINE_SYNTAX
#define MAGIC_MAKE_VARS
#endif
/*
* Step 4: USE_CC_E, DEFAULT_CC, DEFAULT_CPP
@@ -225,10 +212,6 @@ in this Software without prior written authorization from The Open Group.
#ifdef hpux
#define USE_CC_E
#endif
#ifdef WIN32
#define USE_CC_E
#define DEFAULT_CC "cl"
#endif
#if defined(_IBMR2) && !defined(DEFAULT_CPP)
#define DEFAULT_CPP "/usr/ccs/lib/cpp"
#endif
@@ -475,14 +458,6 @@ char *cpp_argv[ARGUMENTS] = {
"-DSVR4",
#endif
#endif
#ifdef WIN32
"-DWIN32",
"-nologo",
#if _MSC_VER < 1000
"-batch",
#endif
"-D__STDC__",
#endif
#ifdef NCR
"-DNCR", /* NCR */
#endif