From: Bruno Haible Date: Sun, 24 Aug 2003 13:58:15 +0000 (+0000) Subject: Add extern "C" { ... }. X-Git-Tag: v0.13~325 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fca4e8d1c09d6260b83b1b61c6f5ef8b7e3b0f7c;p=thirdparty%2Fgettext.git Add extern "C" { ... }. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 02d79b66f..6059ae699 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,7 @@ +2003-08-24 Bruno Haible + + * relocatable.h: Make this file includable in C++ mode: add extern "C". + 2003-08-23 Bruno Haible * Makefile.in (LTV_CURRENT, LTV_REVISION, LTV_AGE): Bump to 6:0:4. diff --git a/gettext-runtime/intl/relocatable.h b/gettext-runtime/intl/relocatable.h index d141200a6..48c5b71e2 100644 --- a/gettext-runtime/intl/relocatable.h +++ b/gettext-runtime/intl/relocatable.h @@ -20,6 +20,11 @@ #ifndef _RELOCATABLE_H #define _RELOCATABLE_H +#ifdef __cplusplus +extern "C" { +#endif + + /* This can be enabled through the configure --enable-relocatable option. */ #if ENABLE_RELOCATABLE @@ -64,4 +69,9 @@ extern const char * compute_curr_prefix (const char *orig_installprefix, #endif + +#ifdef __cplusplus +} +#endif + #endif /* _RELOCATABLE_H */ diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 529016007..1b095f50f 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,16 @@ +2003-08-24 Bruno Haible + + * basename.h: Make this file includable in C++ mode: add extern "C". + * error-progname.h: Likewise. + * pathname.h: Likewise. + * progname.h: Likewise. + * relocatable.h: Likewise. + * stpcpy.h: Likewise. + * strcase.h: Likewise. + * strstr.h: Likewise. + * xerror.h: Likewise. + * xmalloc.h: Likewise. + 2003-08-23 Bruno Haible * getline.h: Update from gnulib. diff --git a/gettext-tools/lib/basename.h b/gettext-tools/lib/basename.h index 03059582b..7f0812f13 100644 --- a/gettext-tools/lib/basename.h +++ b/gettext-tools/lib/basename.h @@ -1,5 +1,5 @@ /* Pathname hacking. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -22,6 +22,12 @@ /* This is where basename() is declared. */ #include + +#ifdef __cplusplus +extern "C" { +#endif + + #if !(__GLIBC__ >= 2) /* When not using the GNU libc we use the basename implementation we provide here. */ @@ -29,4 +35,10 @@ extern char *gnu_basename (const char *); #define basename(Arg) gnu_basename (Arg) #endif + +#ifdef __cplusplus +} +#endif + + #endif /* _BASENAME_H */ diff --git a/gettext-tools/lib/error-progname.h b/gettext-tools/lib/error-progname.h index ed5342f8e..f13d55de9 100644 --- a/gettext-tools/lib/error-progname.h +++ b/gettext-tools/lib/error-progname.h @@ -28,6 +28,12 @@ error_print_progname = maybe_print_progname; */ + +#ifdef __cplusplus +extern "C" { +#endif + + /* Indicates whether errors and warnings get prefixed with program_name. Default is true. A reason to omit the prefix is for better interoperability with Emacs' @@ -38,4 +44,10 @@ extern bool error_with_progname; is true. */ extern void maybe_print_progname (void); + +#ifdef __cplusplus +} +#endif + + #endif /* _ERROR_PROGNAME_H */ diff --git a/gettext-tools/lib/pathname.h b/gettext-tools/lib/pathname.h index 7b817a4f7..bac881798 100644 --- a/gettext-tools/lib/pathname.h +++ b/gettext-tools/lib/pathname.h @@ -1,5 +1,5 @@ /* Pathname support. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,6 +18,11 @@ #ifndef _PATHNAME_H #define _PATHNAME_H +#ifdef __cplusplus +extern "C" { +#endif + + /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, @@ -47,4 +52,8 @@ extern char *concatenated_pathname (const char *directory, const char *filename, const char *suffix); +#ifdef __cplusplus +} +#endif + #endif /* _PATHNAME_H */ diff --git a/gettext-tools/lib/progname.h b/gettext-tools/lib/progname.h index 89f0127c7..85169c356 100644 --- a/gettext-tools/lib/progname.h +++ b/gettext-tools/lib/progname.h @@ -25,6 +25,12 @@ set_program_name (argv[0]); */ + +#ifdef __cplusplus +extern "C" { +#endif + + /* String containing name the program is called with. */ extern const char *program_name; @@ -47,4 +53,10 @@ extern char *get_full_program_name (void); #endif + +#ifdef __cplusplus +} +#endif + + #endif /* _PROGNAME_H */ diff --git a/gettext-tools/lib/relocatable.h b/gettext-tools/lib/relocatable.h index d141200a6..48c5b71e2 100644 --- a/gettext-tools/lib/relocatable.h +++ b/gettext-tools/lib/relocatable.h @@ -20,6 +20,11 @@ #ifndef _RELOCATABLE_H #define _RELOCATABLE_H +#ifdef __cplusplus +extern "C" { +#endif + + /* This can be enabled through the configure --enable-relocatable option. */ #if ENABLE_RELOCATABLE @@ -64,4 +69,9 @@ extern const char * compute_curr_prefix (const char *orig_installprefix, #endif + +#ifdef __cplusplus +} +#endif + #endif /* _RELOCATABLE_H */ diff --git a/gettext-tools/lib/stpcpy.h b/gettext-tools/lib/stpcpy.h index b579c5c9d..5e737cfd5 100644 --- a/gettext-tools/lib/stpcpy.h +++ b/gettext-tools/lib/stpcpy.h @@ -25,9 +25,17 @@ #else +#ifdef __cplusplus +extern "C" { +#endif + /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ extern char *stpcpy (char *dst, const char *src); +#ifdef __cplusplus +} +#endif + #endif #endif /* _STPCPY_H */ diff --git a/gettext-tools/lib/strcase.h b/gettext-tools/lib/strcase.h index f17e64832..9461392f8 100644 --- a/gettext-tools/lib/strcase.h +++ b/gettext-tools/lib/strcase.h @@ -20,6 +20,12 @@ #include + +#ifdef __cplusplus +extern "C" { +#endif + + /* Compare strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. @@ -32,4 +38,10 @@ extern int strcasecmp (const char *s1, const char *s2); Note: This function can not work correctly in multibyte locales. */ extern int strncasecmp (const char *s1, const char *s2, size_t n); + +#ifdef __cplusplus +} +#endif + + #endif /* _STRCASE_H */ diff --git a/gettext-tools/lib/strstr.h b/gettext-tools/lib/strstr.h index e424b8340..f244b9644 100644 --- a/gettext-tools/lib/strstr.h +++ b/gettext-tools/lib/strstr.h @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,7 +22,15 @@ #else +#ifdef __cplusplus +extern "C" { +#endif + /* Find the first occurrence of NEEDLE in HAYSTACK. */ extern char *strstr (const char *haystack, const char *needle); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gettext-tools/lib/xerror.h b/gettext-tools/lib/xerror.h index 543ac96d0..6e93b7954 100644 --- a/gettext-tools/lib/xerror.h +++ b/gettext-tools/lib/xerror.h @@ -1,5 +1,5 @@ /* Multiline error-reporting functions. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -22,6 +22,12 @@ /* Get fallback definition of __attribute__. */ #include "error.h" + +#ifdef __cplusplus +extern "C" { +#endif + + /* Format a message and return the freshly allocated resulting string. */ extern char *xasprintf (const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); @@ -38,4 +44,10 @@ extern void multiline_warning (char *prefix, char *message); PREFIX is NULL. Free the PREFIX and MESSAGE when done. */ extern void multiline_error (char *prefix, char *message); + +#ifdef __cplusplus +} +#endif + + #endif /* _XERROR_H */ diff --git a/gettext-tools/lib/xmalloc.h b/gettext-tools/lib/xmalloc.h index aa85e1f5f..2d2a58116 100644 --- a/gettext-tools/lib/xmalloc.h +++ b/gettext-tools/lib/xmalloc.h @@ -22,6 +22,11 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + + /* Defined in xmalloc.c. */ /* Allocate SIZE bytes of memory dynamically, with error checking. */ @@ -51,4 +56,9 @@ extern void xalloc_die (void) extern char *xstrdup (const char *string); +#ifdef __cplusplus +} +#endif + + #endif /* _XMALLOC_H */ diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 3e1fcdc9e..58ac8f23d 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,20 @@ +2003-08-24 Bruno Haible + + * dir-list.h: Make this file includable in C++ mode: add extern "C". + * file-list.h: Likewise. + * format.h: Likewise. + * message.h: Likewise. + * msgl-ascii.h: Likewise. + * msgl-iconv.h: Likewise. + * open-po.h: Likewise. + * po-charset.h: Likewise. + * po-time.h: Likewise. + * read-po-abstract.h: Likewise. + * str-list.h: Likewise. + * write-po.h: Likewise. + * xgettext.h: Likewise. + * xgettext.c: Add extern "C" around all "x-*.h" includes. + 2003-08-22 Bruno Haible * format-awk.c: Include error-progname.h instead of progname.h. diff --git a/gettext-tools/src/dir-list.h b/gettext-tools/src/dir-list.h index dc8ad21c6..5e6b6ea47 100644 --- a/gettext-tools/src/dir-list.h +++ b/gettext-tools/src/dir-list.h @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1996, 1998, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 2000-2003 Free Software Foundation, Inc. This file was written by Peter Miller @@ -24,6 +24,12 @@ It is an ordered list, without duplicates. The default value of the list consists of the single directory ".". */ + +#ifdef __cplusplus +extern "C" { +#endif + + /* Append a directory to the end of the list of directories. */ extern void dir_list_append (const char *directory); @@ -37,4 +43,10 @@ extern void *dir_list_save_reset (void); /* Restore a previously saved list of directories. */ extern void dir_list_restore (void *saved_value); + +#ifdef __cplusplus +} +#endif + + #endif /* _DIR_LIST_H */ diff --git a/gettext-tools/src/file-list.h b/gettext-tools/src/file-list.h index 9d34d0f4a..76952dfb0 100644 --- a/gettext-tools/src/file-list.h +++ b/gettext-tools/src/file-list.h @@ -1,5 +1,5 @@ /* Reading file lists. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -21,9 +21,21 @@ #include "str-list.h" + +#ifdef __cplusplus +extern "C" { +#endif + + /* Read list of filenames from a file. One filename per line. Lines starting with # and whitespace lines are ignored. Trailing whitespace is removed. */ extern string_list_ty *read_names_from_file (const char *file_name); + +#ifdef __cplusplus +} +#endif + + #endif /* _FILE_LIST_H */ diff --git a/gettext-tools/src/format.h b/gettext-tools/src/format.h index b62ec2ccf..ad01e5bfa 100644 --- a/gettext-tools/src/format.h +++ b/gettext-tools/src/format.h @@ -24,6 +24,12 @@ #include "pos.h" /* Get lex_pos_ty. */ #include "message.h" /* Get NFORMATS. */ + +#ifdef __cplusplus +extern "C" { +#endif + + /* This structure describes a format string parser for a language. */ struct formatstring_parser { @@ -85,4 +91,10 @@ struct interval }; extern void get_c99_format_directives (const char *string, struct interval **intervalsp, size_t *lengthp); + +#ifdef __cplusplus +} +#endif + + #endif /* _FORMAT_H */ diff --git a/gettext-tools/src/message.h b/gettext-tools/src/message.h index 482198744..4968b5ec1 100644 --- a/gettext-tools/src/message.h +++ b/gettext-tools/src/message.h @@ -26,6 +26,12 @@ #include + +#ifdef __cplusplus +extern "C" { +#endif + + /* According to Sun's Uniforum proposal the default message domain is named 'messages'. */ #define MESSAGE_DOMAIN_DEFAULT "messages" @@ -259,4 +265,9 @@ extern message_ty * msgdomain_list_search_fuzzy (msgdomain_list_ty *mdlp, const char *msgid); +#ifdef __cplusplus +} +#endif + + #endif /* message.h */ diff --git a/gettext-tools/src/msgl-ascii.h b/gettext-tools/src/msgl-ascii.h index c4e9bd2d4..bff312964 100644 --- a/gettext-tools/src/msgl-ascii.h +++ b/gettext-tools/src/msgl-ascii.h @@ -1,5 +1,5 @@ /* Message list test for ASCII character set. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -23,6 +23,12 @@ #include + +#ifdef __cplusplus +extern "C" { +#endif + + extern bool is_ascii_string (const char *string); extern bool @@ -32,4 +38,10 @@ extern bool extern bool is_ascii_message_list (message_list_ty *mlp); + +#ifdef __cplusplus +} +#endif + + #endif /* _MSGL_ASCII_H */ diff --git a/gettext-tools/src/msgl-iconv.h b/gettext-tools/src/msgl-iconv.h index 0428452f9..44acb71bd 100644 --- a/gettext-tools/src/msgl-iconv.h +++ b/gettext-tools/src/msgl-iconv.h @@ -1,5 +1,5 @@ /* Message list character set conversion. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -25,6 +25,12 @@ #include "message.h" + +#ifdef __cplusplus +extern "C" { +#endif + + #if HAVE_ICONV /* Converts the STRING through the conversion descriptor CD. */ extern char *convert_string (iconv_t cd, const char *string); @@ -46,4 +52,10 @@ extern msgdomain_list_ty * const char *to_code, const char *from_filename); + +#ifdef __cplusplus +} +#endif + + #endif /* _MSGL_ICONV_H */ diff --git a/gettext-tools/src/open-po.h b/gettext-tools/src/open-po.h index 734f8f687..cc561f26f 100644 --- a/gettext-tools/src/open-po.h +++ b/gettext-tools/src/open-po.h @@ -21,6 +21,12 @@ #include #include + +#ifdef __cplusplus +extern "C" { +#endif + + /* Open the input file with the name INPUT_NAME. The ending .po is added if necessary. If INPUT_NAME is not an absolute file name and the file is not found, the list of directories in "dir-list.h" is searched. The @@ -29,4 +35,10 @@ extern FILE *open_po_file (const char *input_name, char **real_file_name_p, bool exit_on_error); + +#ifdef __cplusplus +} +#endif + + #endif /* _OPEN_PO_H */ diff --git a/gettext-tools/src/po-charset.h b/gettext-tools/src/po-charset.h index 9b03a0dfc..887a5b4fe 100644 --- a/gettext-tools/src/po-charset.h +++ b/gettext-tools/src/po-charset.h @@ -1,5 +1,5 @@ /* Charset handling while reading PO files. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -25,6 +25,12 @@ #include #endif + +#ifdef __cplusplus +extern "C" { +#endif + + /* Canonicalize an encoding name. The results of this function are statically allocated and can be compared using ==. */ @@ -71,4 +77,10 @@ extern void po_lex_charset_set (const char *header_entry, /* Finish up with the PO file's encoding. */ extern void po_lex_charset_close (void); + +#ifdef __cplusplus +} +#endif + + #endif /* _PO_CHARSET_H */ diff --git a/gettext-tools/src/po-time.h b/gettext-tools/src/po-time.h index 941309a12..869172f83 100644 --- a/gettext-tools/src/po-time.h +++ b/gettext-tools/src/po-time.h @@ -1,5 +1,5 @@ /* PO/POT file timestamps. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -21,8 +21,19 @@ #include + +#ifdef __cplusplus +extern "C" { +#endif + + /* Return a freshly allocated string containing the given time in the format YYYY-MM-DD HH:MM+TZOFF. */ extern char *po_strftime (const time_t *tp); + +#ifdef __cplusplus +} +#endif + #endif /* _PO_TIME_H */ diff --git a/gettext-tools/src/read-po-abstract.h b/gettext-tools/src/read-po-abstract.h index 4140fc873..85b960f97 100644 --- a/gettext-tools/src/read-po-abstract.h +++ b/gettext-tools/src/read-po-abstract.h @@ -25,6 +25,12 @@ #include + +#ifdef __cplusplus +extern "C" { +#endif + + /* Note: the _t suffix is reserved by ANSI C, so the _ty suffix is used to indicate a type name. */ @@ -161,4 +167,10 @@ extern void po_parse_comment_special (const char *s, bool *fuzzyp, enum is_format formatp[NFORMATS], enum is_wrap *wrapp); + +#ifdef __cplusplus +} +#endif + + #endif /* _READ_PO_ABSTRACT_H */ diff --git a/gettext-tools/src/str-list.h b/gettext-tools/src/str-list.h index 086b931a3..f316c9729 100644 --- a/gettext-tools/src/str-list.h +++ b/gettext-tools/src/str-list.h @@ -26,6 +26,12 @@ /* Get bool. */ #include + +#ifdef __cplusplus +extern "C" { +#endif + + /* Type describing list of immutable strings, implemented using a dynamic array. */ typedef struct string_list_ty string_list_ty; @@ -72,4 +78,10 @@ extern char *string_list_join (const string_list_ty *slp); /* Return 1 if s is contained in the list of strings, 0 otherwise. */ extern bool string_list_member (const string_list_ty *slp, const char *s); + +#ifdef __cplusplus +} +#endif + + #endif /* _STR_LIST_H */ diff --git a/gettext-tools/src/write-po.h b/gettext-tools/src/write-po.h index a1a81ef4b..5cbe3199a 100644 --- a/gettext-tools/src/write-po.h +++ b/gettext-tools/src/write-po.h @@ -25,6 +25,12 @@ #include #include + +#ifdef __cplusplus +extern "C" { +#endif + + /* These functions output parts of a message, as comments. */ extern void message_print_comment (const message_ty *mp, FILE *fp); @@ -64,4 +70,10 @@ extern void extern void msgdomain_list_sort_by_filepos (msgdomain_list_ty *mdlp); + +#ifdef __cplusplus +} +#endif + + #endif /* _WRITE_PO_H */ diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index 559d8ad7d..0bb9adb2c 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -63,6 +63,10 @@ #define _(str) gettext (str) +#ifdef __cplusplus +extern "C" { +#endif + #include "x-c.h" #include "x-po.h" #include "x-python.h" @@ -80,6 +84,10 @@ #include "x-rst.h" #include "x-glade.h" +#ifdef __cplusplus +} +#endif + /* If nonzero add all comments immediately preceding one of the keywords. */ static bool add_all_comments = false; diff --git a/gettext-tools/src/xgettext.h b/gettext-tools/src/xgettext.h index 8086054d5..b20940530 100644 --- a/gettext-tools/src/xgettext.h +++ b/gettext-tools/src/xgettext.h @@ -32,6 +32,12 @@ /* Declare 'line_comment' and 'input_syntax'. */ #include "read-po.h" + +#ifdef __cplusplus +extern "C" { +#endif + + /* If true, omit the header entry. If false, keep the header entry present in the input. */ extern int xgettext_omit_header; @@ -91,4 +97,9 @@ extern void remember_a_message_plural (message_ty *mp, char *string, lex_pos_ty *pos); +#ifdef __cplusplus +} +#endif + + #endif /* _XGETTEXT_H */