summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-09 16:13:07 +0000
committerKarl Berry <karl@freefriends.org>2012-04-09 16:13:07 +0000
commit50f4aaa330b7549bc663dfc6701ddbc497782c47 (patch)
treed2c3b34f4a26b3155fac42ff6e24c59e72d15b09
parent4f6fa857ec06873b5eaa5443a19e7b84b97b81c4 (diff)
do not declare getopt under C++ (http://bugs.debian.org/667392); do not declare popen/pclose at all (http://bugs.debian.org/64524)
git-svn-id: svn://tug.org/texlive/trunk@25879 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/kpathsea/ChangeLog10
-rw-r--r--Build/source/texk/kpathsea/c-std.h9
-rw-r--r--Build/source/texk/kpathsea/getopt.h6
3 files changed, 16 insertions, 9 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 06d2ba0b5dd..dd54531130a 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,13 @@
+2012-04-09 Karl Berry <karl@tug.org>
+
+ * getopt.h (getopt) [!__cplusplus]: do not declare when compiling
+ with C++, since g++ 4.7.0 introduced an incompatible declaration.
+ http://bugs.debian.org/667392
+
+ * c-std.h (popen, pclose) [!VMS]: remove these decls to avoid
+ conflicts, hoping they are now always in the system libraries.
+ http://bugs.debian.org/64524
+
2012-04-07 Karl Berry <karl@tug.org>
* texmf.cnf (glob_str_size): increase from 5000 to 20000 per Akira,
diff --git a/Build/source/texk/kpathsea/c-std.h b/Build/source/texk/kpathsea/c-std.h
index 6d0169d16ae..b4d22a7743e 100644
--- a/Build/source/texk/kpathsea/c-std.h
+++ b/Build/source/texk/kpathsea/c-std.h
@@ -1,6 +1,6 @@
/* c-std.h: the first header files.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2008 Karl Berry.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2008, 2012 Karl Berry.
Copyright 1999, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -86,13 +86,6 @@ extern ALLOC_RETURN_TYPE *calloc (), *malloc (), *realloc ();
#ifdef VMS
#include <unixlib.h>
#include <unixio.h>
-#else
-#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 && 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 c899189bebc..a2530b8bf8f 100644
--- a/Build/source/texk/kpathsea/getopt.h
+++ b/Build/source/texk/kpathsea/getopt.h
@@ -120,8 +120,12 @@ struct option
#if defined(__GNU_LIBRARY__) || defined (WIN32) || defined (__CYGWIN__)
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
+ errors, only prototype getopt for the GNU C library. And not when
+ compiling with C++; g++ 4.7.0 has introduced a conflicting
+ declaration. */
+#if !defined (__cplusplus)
extern KPSEDLL int getopt (int argc, char *const *argv, const char *shortopts);
+#endif
#if defined (__MINGW32__) || defined (__CYGWIN__)
#define __GETOPT_H__ /* Avoid that <unistd.h> redeclares the getopt API. */
#endif