summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-03-17 11:02:17 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-03-17 11:02:17 +0000
commitcc9e2cf485fdc6d0689f5943154c593d9f3696e6 (patch)
treecf6d7f26a372ab41a291c58597e0da38204c79b2 /Build/source/texk
parentf02c90b67527cfb210815f40184019554d107cbd (diff)
make kpathsea C++ safe, adapt xdv2pdf to new kpathsea API
git-svn-id: svn://tug.org/texlive/trunk@12405 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog4
-rw-r--r--Build/source/texk/kpathsea/c-std.h4
-rw-r--r--Build/source/texk/kpathsea/getopt.h2
-rw-r--r--Build/source/texk/xdv2pdf/ChangeLog6
-rw-r--r--Build/source/texk/xdv2pdf/xdv2pdf.cpp12
5 files changed, 20 insertions, 8 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 983b83b762e..cad1832c652 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,7 @@
+2009-03-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * c-std.h, getopt.h: Avoid non-prototype declarations for C++.
+
2009-03-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* db.c, debug.c, debug.h, dir.c, elt-dirs.c, hash.c, pathsearch.c,
diff --git a/Build/source/texk/kpathsea/c-std.h b/Build/source/texk/kpathsea/c-std.h
index 980c115901f..40e0ce78bd0 100644
--- a/Build/source/texk/kpathsea/c-std.h
+++ b/Build/source/texk/kpathsea/c-std.h
@@ -87,12 +87,12 @@ extern ALLOC_RETURN_TYPE *calloc (), *malloc (), *realloc ();
#include <unixlib.h>
#include <unixio.h>
#else
-#ifndef WIN32
+#if !defined (WIN32) && !defined (__cplusplus)
/* `popen' and `pclose' are part of POSIX.2, not POSIX.1. So
STDC_HEADERS isn't enough. */
extern FILE *popen ();
extern int pclose ();
-#endif /* not WIN32 */
+#endif /* not WIN32 && not __cplusplus */
#endif /* not VMS */
#endif /* not KPATHSEA_C_STD_H */
diff --git a/Build/source/texk/kpathsea/getopt.h b/Build/source/texk/kpathsea/getopt.h
index 49efaff3b8a..c0098f19ba6 100644
--- a/Build/source/texk/kpathsea/getopt.h
+++ b/Build/source/texk/kpathsea/getopt.h
@@ -123,7 +123,9 @@ struct option
errors, only prototype getopt for the GNU C library. */
extern KPSEDLL int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
+#ifndef __cplusplus
extern KPSEDLL int getopt ();
+#endif /* not __cplusplus */
#endif /* __GNU_LIBRARY__ */
extern KPSEDLL int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
diff --git a/Build/source/texk/xdv2pdf/ChangeLog b/Build/source/texk/xdv2pdf/ChangeLog
index edcca55dcf1..c5e9bc6fa7e 100644
--- a/Build/source/texk/xdv2pdf/ChangeLog
+++ b/Build/source/texk/xdv2pdf/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * xdv2pdf.cpp: Reestablish the '-d' option.
+ #include <kpathsea/kpathsea.h> and reinterpret_cast for type
+ conversion.
+
2009-03-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* xdv2pdf.cpp: As a temporary fix, disable the '-d' option.
diff --git a/Build/source/texk/xdv2pdf/xdv2pdf.cpp b/Build/source/texk/xdv2pdf/xdv2pdf.cpp
index 8353f2c4fc8..10584555885 100644
--- a/Build/source/texk/xdv2pdf/xdv2pdf.cpp
+++ b/Build/source/texk/xdv2pdf/xdv2pdf.cpp
@@ -931,10 +931,13 @@ doPicFile(FILE* xdv, int pdfBoxType) // t[4][6] p[2] l[2] a[l]
/* declarations of KPATHSEARCH functions we use for finding TFMs and OTFs */
extern "C" {
- UInt8* kpse_find_file(const UInt8* name, int type, int must_exist);
- UInt8* uppercasify(const UInt8* s);
+#include <kpathsea/kpathsea.h>
+#define kpse_find_file(name, type, must_exist) reinterpret_cast<UInt8*> \
+ (kpse_find_file(reinterpret_cast<const_string>(name), \
+ (kpse_file_format_type)type, must_exist))
+#define uppercasify(s) reinterpret_cast<UInt8*> \
+ (uppercasify(reinterpret_cast<const_string>(s)))
};
-//extern unsigned kpathsea_debug;
#include "xdv_kpse_formats.h"
@@ -2270,10 +2273,7 @@ xdv2pdf(int argc, char** argv)
break;
case 'd':
- {
- unsigned int kpathsea_debug;
kpathsea_debug |= atoi(optarg);
- }
break;
case 'v':