From 50f4aaa330b7549bc663dfc6701ddbc497782c47 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 9 Apr 2012 16:13:07 +0000 Subject: 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 --- Build/source/texk/kpathsea/ChangeLog | 10 ++++++++++ Build/source/texk/kpathsea/c-std.h | 9 +-------- Build/source/texk/kpathsea/getopt.h | 6 +++++- 3 files changed, 16 insertions(+), 9 deletions(-) (limited to 'Build/source') 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 + + * 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 * 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 #include -#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 redeclares the getopt API. */ #endif -- cgit v1.2.3