diff options
author | Karl Berry <karl@freefriends.org> | 2010-01-31 00:37:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-01-31 00:37:08 +0000 |
commit | fddb3638f20eff3f5c3a2f87103b8c1f330a637d (patch) | |
tree | 26e8107bf7dc9849f4727c8e5e2758106afe216d /Build | |
parent | b251a1a9ddd70c3703f12bb312787f0406f368cd (diff) |
reinstate win32lib.h and make other _WIN32-related changes, for compilation with MSVC 7.1; from Javier Mugica
git-svn-id: svn://tug.org/texlive/trunk@16876 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 11 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/c-ctype.h | 10 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/c-stat.h | 6 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/config.h | 13 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/getopt.h | 12 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/getopt1.c | 6 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/win32lib.h | 52 |
7 files changed, 77 insertions, 33 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 89c3ee81a4e..5f1da84a217 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,14 @@ +2010-01-31 Javier Mugica <javier@digi21.eu> + + Support compilation with MSVC 7.1: + * config.h (win32lib.h) [_WIN32 && !__MINGW32__]: include. + (__STDC__) [WIN32]: do not define ourselves. + * getopt.h (__STDC__): do not define ourselves. Instead, define + const. + * c-stat.h (oldnames.h) [WIN32]: is gone. + * c-ctype.h (isascii): no oldnames.h here either. + * win32lib.h: reinstate. + 2010-01-25 Peter Breitenlohner <peb@mppmu.mpg.de> * xputenv.c (kpathsea_xputenv): Don't use value of XRETALLOC(), diff --git a/Build/source/texk/kpathsea/c-ctype.h b/Build/source/texk/kpathsea/c-ctype.h index 005943d5cb0..53f7f4b5209 100644 --- a/Build/source/texk/kpathsea/c-ctype.h +++ b/Build/source/texk/kpathsea/c-ctype.h @@ -1,6 +1,6 @@ /* c-ctype.h: ASCII-safe versions of the <ctype.h> macros. - Copyright 1992, 1994, 2008 Karl Berry. + Copyright 1992, 1994, 2008, 2010 Karl Berry. Copyright 1998, 2000, 2005 Olaf Weber. This library is free software; you can redistribute it and/or @@ -21,16 +21,10 @@ #include <ctype.h> -/* Be sure we have `isascii'. */ -#ifdef WIN32 -#ifndef __MINGW32__ -#include <oldnames.h> -#endif -#else +/* Be sure we have `isascii', even if wrong. */ #ifndef isascii #define isascii(c) 1 #endif -#endif #define ISALNUM(c) (isascii (c) && isalnum(c)) #define ISALPHA(c) (isascii (c) && isalpha(c)) diff --git a/Build/source/texk/kpathsea/c-stat.h b/Build/source/texk/kpathsea/c-stat.h index 8d7210b3cf5..d222fd8de01 100644 --- a/Build/source/texk/kpathsea/c-stat.h +++ b/Build/source/texk/kpathsea/c-stat.h @@ -1,6 +1,6 @@ /* c-stat.h: declarations for using stat(2). - Copyright 1993, 1996, 2008 Karl Berry. + Copyright 1993, 1996, 2008, 2010 Karl Berry. Copyright 1998, 2000, 2005 Olaf Weber. This library is free software; you can redistribute it and/or @@ -22,10 +22,6 @@ #include <kpathsea/systypes.h> #include <sys/stat.h> -#if defined (WIN32) && !defined (__MINGW32__) -#include <oldnames.h> -#endif - /* POSIX predicates for testing file attributes. */ #if !defined (S_ISBLK) && defined (S_IFBLK) diff --git a/Build/source/texk/kpathsea/config.h b/Build/source/texk/kpathsea/config.h index 33ce2db7c97..d9e4123b25f 100644 --- a/Build/source/texk/kpathsea/config.h +++ b/Build/source/texk/kpathsea/config.h @@ -1,7 +1,7 @@ /* config.h: master configuration file, included first by all compilable source files (not headers). - Copyright 1993, 1995, 1996, 1997, 2008 Karl Berry. + Copyright 1993, 1995, 1996, 1997, 2008, 2010 Karl Berry. Copyright 2000, 2003, 2004, 2005 Olaf Weber. This library is free software; you can redistribute it and/or @@ -23,7 +23,7 @@ /* System defines are for non-Unix systems only. (Testing for all Unix variations should be done in configure.) Presently the defines used are: AMIGA DOS OS2 WIN32. I do not use any of these systems myself; - if you do, I'd be grateful for any changes. --olaf@infovore.xs4all.nl */ + if you do, I'd be grateful for any changes. */ #if defined(DJGPP) || defined(__DJGPP__) || \ defined(CYGWIN) || defined(__CYGWIN__) || \ @@ -33,8 +33,7 @@ #endif /* If we have either DOS or OS2, we are DOSISH. Cygwin pretends to be - * unix, mostly, so don't include it here. - */ + Unix, mostly, so don't include it here. */ #if defined(OS2) || \ defined(MSDOS) || defined(__MSDOS__) || defined(DOS) || \ defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || \ @@ -55,10 +54,6 @@ #define DEV_NULL "/dev/null" #endif -#if defined (WIN32) && !defined (__STDC__) -#define __STDC__ 1 -#endif - /* System dependencies that are figured out by `configure'. */ #include <kpathsea/c-auto.h> @@ -95,7 +90,7 @@ This must be included after "c-proto.h" but before "lib.h". FP. */ -#ifdef WIN32 +#if defined (WIN32) || defined (_WIN32) #ifdef __MINGW32__ #include <kpathsea/mingw32.h> #else diff --git a/Build/source/texk/kpathsea/getopt.h b/Build/source/texk/kpathsea/getopt.h index c0098f19ba6..f91650263c8 100644 --- a/Build/source/texk/kpathsea/getopt.h +++ b/Build/source/texk/kpathsea/getopt.h @@ -24,9 +24,11 @@ #ifndef _GETOPT_H #define _GETOPT_H 1 -#if defined(WIN32) -#ifndef __STDC__ -#define __STDC__ 1 +#if !defined (__STDC__) || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const #endif #endif @@ -98,11 +100,7 @@ extern KPSEDLL int optopt; struct option { -#if defined (__STDC__) && __STDC__ const char *name; -#else - char *name; -#endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; diff --git a/Build/source/texk/kpathsea/getopt1.c b/Build/source/texk/kpathsea/getopt1.c index 0b5f957b528..1bbe8877d03 100644 --- a/Build/source/texk/kpathsea/getopt1.c +++ b/Build/source/texk/kpathsea/getopt1.c @@ -1,6 +1,6 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright 2008 Karl Berry. + Copyright 2008, 2010 Karl Berry. Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. The original version of this file was part of the GNU C Library. @@ -100,9 +100,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index) #include <stdio.h> int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int c; int digit_optind = 0; diff --git a/Build/source/texk/kpathsea/win32lib.h b/Build/source/texk/kpathsea/win32lib.h new file mode 100644 index 00000000000..6c1e19cabee --- /dev/null +++ b/Build/source/texk/kpathsea/win32lib.h @@ -0,0 +1,52 @@ +/* This file is public domain. */ + +#ifndef _WIN32LIB_H_ +#define _WIN32LIB_H_ + +#if !__STDC__ +#if _MSC_VER>=1200 + #pragma warning(push) +#endif +#pragma warning(disable: 4668) +#pragma warning(disable: 4255) + +#define boolean donotuse_boolean +#include <windows.h> /* Somewhere here WIN32 gets defined */ +#undef boolean + +#if _MSC_VER>=1200 + #pragma warning(pop) +#else + #pragma warning(default: 4668) + #pragma warning(default: 4255) +#endif + +#else /*__STDC__*/ +/* non-ansi definitions for an ANSI compliation with /Fa */ +#define WIN32 +#define off_t _off_t +#define putenv _putenv +#define getcwd _getcwd +#define getcw _getcw +#define putenv _putenv +#define strdup _strdup +#define vsnprintf _vsnprintf +#define fileno _fileno +#define strlwr _strlwr +#define isascii __isascii +#define mkdir _mkdir +#define stat _stat +#define stricmp _stricmp +#define MAX_PATH _MAX_PATH +#define S_IFREG _S_IFREG +#define S_IFMT _S_IFMT + +#endif /*__STDC__*/ + +//This is not defined even if !__STDC__ +#define snprintf _snprintf + +//The gnu name is different +#define strcasecmp stricmp + +#endif |