summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-07-25 13:28:19 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-07-25 13:28:19 +0000
commitf1615aae3ec6e6c8333f5c09987e5888bd5cd0c6 (patch)
tree2bb209aebad2c74b4e13625e3c81eaeba025e046 /Build/source/texk/kpathsea
parent37cc6f55ef75c928d58cbe6ce9a1e92ba7db5905 (diff)
kpathsea: Minor changes to reduce diffs with W32TeX
git-svn-id: svn://tug.org/texlive/trunk@23219 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog10
-rw-r--r--Build/source/texk/kpathsea/c-ctype.h4
-rw-r--r--Build/source/texk/kpathsea/c-fopen.h10
-rw-r--r--Build/source/texk/kpathsea/magstep.c2
-rw-r--r--Build/source/texk/kpathsea/pathsearch.h2
-rw-r--r--Build/source/texk/kpathsea/readable.c2
-rw-r--r--Build/source/texk/kpathsea/tex-glyph.c9
-rw-r--r--Build/source/texk/kpathsea/win32lib.h5
-rw-r--r--Build/source/texk/kpathsea/xftell.c1
9 files changed, 34 insertions, 11 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index e3f5d838e11..5e4022d6d68 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,13 @@
+2011-07-25 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Minor changes to reduce diffs between TeX Live and W32TeX.
+ * c-ctype.h [WIN32]: Never #define isascii.
+ * c-fopen.h: Always write text files with Unix line endings.
+ * tex-glyph.c (bitmap_specs) [WIN32]: Add DOS_BITMAP_SPEC.
+ * win32lib.h: #define strncasecmp as _strnicmp.
+ * readable.c: Replace #elif WIN32 => #elif defined (WIN32).
+ * magstep.c, pathsearch.h, xftell.c: Adjust whitespace.
+
2011-07-22 Peter Breitenlohner <peb@mppmu.mpg.de>
* kpathsea.c, progname.c, tex-file.c, types.h:
diff --git a/Build/source/texk/kpathsea/c-ctype.h b/Build/source/texk/kpathsea/c-ctype.h
index d05e5e139e8..1a80197b1de 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, 2010 Karl Berry.
+ Copyright 1992, 1994, 2008, 2010, 2011 Karl Berry.
Copyright 1998, 2000, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -22,9 +22,11 @@
#include <ctype.h>
/* Be sure we have `isascii', even if wrong. */
+#ifndef WIN32
#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-fopen.h b/Build/source/texk/kpathsea/c-fopen.h
index 77980570bd2..7b64ef46352 100644
--- a/Build/source/texk/kpathsea/c-fopen.h
+++ b/Build/source/texk/kpathsea/c-fopen.h
@@ -1,6 +1,6 @@
/* c-fopen.h: how to open files with fopen.
- Copyright 1992, 1994, 1995, 1996, 2008 Karl Berry.
+ Copyright 1992, 1994, 1995, 1996, 2008, 2011 Karl Berry.
Copyright 1998, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -20,8 +20,12 @@
#define C_FOPEN_H
/* How to open a text file: */
+/* From Akira:
+ I'm using Unix style line ending character to write text files.
+ I find it is easiest to define FOPEN_W_MODE == FOPEN_WBIN_MODE etc. for
+ my purpose. */
#ifndef FOPEN_A_MODE
-#define FOPEN_A_MODE "a"
+#define FOPEN_A_MODE "ab"
#endif
#ifndef FOPEN_R_MODE
@@ -29,7 +33,7 @@
#endif
#ifndef FOPEN_W_MODE
-#define FOPEN_W_MODE "w"
+#define FOPEN_W_MODE "wb"
#endif
/* How to open a binary file for reading: */
diff --git a/Build/source/texk/kpathsea/magstep.c b/Build/source/texk/kpathsea/magstep.c
index 3f467148a2c..95a16ba5d7c 100644
--- a/Build/source/texk/kpathsea/magstep.c
+++ b/Build/source/texk/kpathsea/magstep.c
@@ -20,7 +20,6 @@
#include <kpathsea/magstep.h>
-
/* Return true magstep N, where the lsb of N means ``half'' (see
magstep.h) for resolution BDPI. From Tom Rokicki's dvips. */
@@ -67,6 +66,7 @@ magstep (int n, int bdpi)
return the true dpi corresponding to DPI with a base resolution of
BDPI. If M_RET is non-null, we also set that to the mag value. */
+
/* Don't bother trying to use fabs or some other ``standard'' routine
which can only cause trouble; just roll our own simple-minded
absolute-value function that is all we need. */
diff --git a/Build/source/texk/kpathsea/pathsearch.h b/Build/source/texk/kpathsea/pathsearch.h
index cdf91f0c3c7..8be5780ea3b 100644
--- a/Build/source/texk/kpathsea/pathsearch.h
+++ b/Build/source/texk/kpathsea/pathsearch.h
@@ -87,7 +87,7 @@ extern KPSEDLL string *kpathsea_all_path_search
/* Search for any of the NAMES in PATH, and allow specifying both
MUST_EXIST and ALL. */
extern KPSEDLL string *kpathsea_path_search_list_generic (kpathsea kpse,
- const_string path, const_string* names, boolean must_exist, boolean all);
+ const_string path, const_string* names, boolean must_exist, boolean all);
/* Search for any of NAMES, with MUST_EXIST and ALL true. */
extern KPSEDLL string *kpathsea_all_path_search_list
diff --git a/Build/source/texk/kpathsea/readable.c b/Build/source/texk/kpathsea/readable.c
index 394e3508d73..8f6b5d12be0 100644
--- a/Build/source/texk/kpathsea/readable.c
+++ b/Build/source/texk/kpathsea/readable.c
@@ -33,7 +33,7 @@
/* `stat' is way too expensive for such a simple job. */
#define READABLE(fn, st) \
(access (fn, R_OK) == 0 && access (fn, D_OK) == -1)
-#elif WIN32
+#elif defined (WIN32)
/* Warning: st must be an unsigned int under Win32 */
static boolean
READABLE(const_string fn, unsigned int st)
diff --git a/Build/source/texk/kpathsea/tex-glyph.c b/Build/source/texk/kpathsea/tex-glyph.c
index f4ca45939dc..79b27f606f5 100644
--- a/Build/source/texk/kpathsea/tex-glyph.c
+++ b/Build/source/texk/kpathsea/tex-glyph.c
@@ -33,6 +33,9 @@
support \'s.) */
#define UNIX_BITMAP_SPEC "$KPATHSEA_NAME.$KPATHSEA_DPI$KPATHSEA_FORMAT"
#define DPI_BITMAP_SPEC "dpi$KPATHSEA_DPI/$KPATHSEA_NAME.$KPATHSEA_FORMAT"
+#ifdef WIN32
+#define DOS_BITMAP_SPEC "$KPATHSEA_DPI/$KPATHSEA_NAME.$KPATHSEA_FORMAT"
+#endif
/* Look up font $KPATHSEA_NAME at resolution $KPATHSEA_DPI in PATH,
with filename suffix EXTENSION. Return file found or NULL. */
@@ -41,7 +44,11 @@ static string
try_format (kpathsea kpse, kpse_file_format_type format)
{
static const_string bitmap_specs[]
- = { UNIX_BITMAP_SPEC, DPI_BITMAP_SPEC, NULL };
+ = { UNIX_BITMAP_SPEC, DPI_BITMAP_SPEC,
+#ifdef WIN32
+ DOS_BITMAP_SPEC,
+#endif
+ NULL };
const_string *spec;
boolean must_exist;
const_string *sfx;
diff --git a/Build/source/texk/kpathsea/win32lib.h b/Build/source/texk/kpathsea/win32lib.h
index fdc1cd999c7..5578aed8770 100644
--- a/Build/source/texk/kpathsea/win32lib.h
+++ b/Build/source/texk/kpathsea/win32lib.h
@@ -50,7 +50,8 @@
/*This is not defined even if !__STDC__*/
#define snprintf _snprintf
-/*The gnu name is different*/
-#define strcasecmp stricmp
+/* The POSIX names are different */
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
#endif
diff --git a/Build/source/texk/kpathsea/xftell.c b/Build/source/texk/kpathsea/xftell.c
index 96d8084f181..123f49a75b9 100644
--- a/Build/source/texk/kpathsea/xftell.c
+++ b/Build/source/texk/kpathsea/xftell.c
@@ -18,7 +18,6 @@
#include <kpathsea/config.h>
-
long
xftell (FILE *f, const_string filename)
{