From 2c4a44a5d092da2f1c2864b27ca382f77faeb63d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 6 Nov 2006 12:55:16 +0000 Subject: [PATCH] Avoid name mangling in C++ mode. --- ChangeLog | 7 +++++++ lib/c-ctype.h | 10 ++++++++++ lib/fwriteerror.h | 8 ++++++++ lib/gcd.h | 12 +++++++++++- lib/linebreak.h | 12 +++++++++++- 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3dc6ed03d..17453822d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-11-03 Bruno Haible + + * lib/c-ctype.h [C++]: Define functions without name mangling. + * lib/fwriteerror.h [C++]: Likewise. + * lib/gcd.h [C++]: Likewise. + * lib/linebreak.h [C++]: Likewise. + 2006-11-03 Paul Eggert * lib/canonicalize.h: (canonicalize_mode_t, CAN_EXISTING): diff --git a/lib/c-ctype.h b/lib/c-ctype.h index 395c7a136..b26eccfb3 100644 --- a/lib/c-ctype.h +++ b/lib/c-ctype.h @@ -27,6 +27,11 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include +#ifdef __cplusplus +extern "C" { +#endif + + /* The functions defined in this file assume the "C" locale and a character set without diacritics (ASCII-US or EBCDIC-US or something like that). Even if the "C" locale on a particular system is an extension of the ASCII @@ -267,4 +272,9 @@ extern int c_toupper (int c); #endif /* optimizing for speed */ + +#ifdef __cplusplus +} +#endif + #endif /* C_CTYPE_H */ diff --git a/lib/fwriteerror.h b/lib/fwriteerror.h index ebbe1be6c..24d8e0ad4 100644 --- a/lib/fwriteerror.h +++ b/lib/fwriteerror.h @@ -40,6 +40,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Write out the not yet written buffered contents of the stream FP, close the stream FP, and test whether some error occurred on the stream FP. FP must be a stream opened for writing. @@ -53,3 +57,7 @@ extern int fwriteerror (FILE *fp); /* Likewise, but don't consider it an error if FP has an invalid file descriptor and no output was done to FP. */ extern int fwriteerror_no_ebadf (FILE *fp); + +#ifdef __cplusplus +} +#endif diff --git a/lib/gcd.h b/lib/gcd.h index 6fbaf8242..cf2b7fd84 100644 --- a/lib/gcd.h +++ b/lib/gcd.h @@ -1,5 +1,5 @@ /* Arithmetic. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -19,7 +19,17 @@ #ifndef _GCD_H #define _GCD_H +#ifdef __cplusplus +extern "C" { +#endif + + /* Return the greatest common divisor of a > 0 and b > 0. */ extern unsigned long gcd (unsigned long a, unsigned long b); + +#ifdef __cplusplus +} +#endif + #endif /* _GCD_H */ diff --git a/lib/linebreak.h b/lib/linebreak.h index 56d8b1eb8..4a27aab11 100644 --- a/lib/linebreak.h +++ b/lib/linebreak.h @@ -1,5 +1,5 @@ /* linebreak.h - line breaking of Unicode strings - Copyright (C) 2001-2003 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -23,6 +23,11 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include +#ifdef __cplusplus +extern "C" { +#endif + + /* Display width. */ /* These functions are locale dependent. The encoding argument identifies @@ -100,4 +105,9 @@ extern int char *p); +#ifdef __cplusplus +} +#endif + + #endif /* _LINEBREAK_H */ -- 2.11.0