From: Bruno Haible Date: Fri, 24 Oct 2003 10:23:02 +0000 (+0000) Subject: Make it compile in C++ mode as well. X-Git-Tag: v0.13~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a3fb8ab11bb42e171f181cb04712e314609d8b8;p=thirdparty%2Fgettext.git Make it compile in C++ mode as well. --- diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 94982caf0..3e15fa353 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,7 @@ +2003-10-14 Bruno Haible + + * hash.h: Make it includable in C++ mode. + 2003-10-21 Bruno Haible * canonicalize.c (lstat): Define as an alias to 'stat' on systems diff --git a/gettext-tools/lib/hash.h b/gettext-tools/lib/hash.h index 10e512c9d..07b1de461 100644 --- a/gettext-tools/lib/hash.h +++ b/gettext-tools/lib/hash.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 2000-2002 Free Software Foundation, Inc. +/* Copyright (C) 1995, 2000-2003 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -16,9 +16,13 @@ - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HASH_H -# define _HASH_H +#define _HASH_H -# include +#include + +#ifdef __cplusplus +extern "C" { +#endif typedef struct hash_table { @@ -45,4 +49,8 @@ extern int iterate_table (hash_table *htab, void **ptr, extern unsigned long int next_prime (unsigned long int seed); +#ifdef __cplusplus +} +#endif + #endif /* not _HASH_H */ diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 4698ba38a..496c6c799 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2003-10-14 Bruno Haible + + Fix compilation errors in C++ mode. + * msgfilter.c (process_string): Cast the xrealloc expression. + * xgettext.c (language_to_extractor, extension_to_language): Move the + typedef after the struct definition. + 2003-10-13 Bruno Haible Support CR/LF line terminators in C sources even on Unix. diff --git a/gettext-tools/src/msgfilter.c b/gettext-tools/src/msgfilter.c index 88b6ed0cd..e7b418c50 100644 --- a/gettext-tools/src/msgfilter.c +++ b/gettext-tools/src/msgfilter.c @@ -659,7 +659,7 @@ process_string (const char *str, size_t len, char **resultp, size_t *lengthp) if (length == allocated) { allocated = allocated + (allocated >> 1); - result = xrealloc (result, allocated); + result = (char *) xrealloc (result, allocated); } { ssize_t nread = read (fd[0], result + length, allocated - length); diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index 1e3f4e7fb..ae3d3f814 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -2069,7 +2069,6 @@ finalize_header (msgdomain_list_ty *mdlp) static extractor_ty language_to_extractor (const char *name) { - typedef struct table_ty table_ty; struct table_ty { const char *name; @@ -2078,6 +2077,7 @@ language_to_extractor (const char *name) struct formatstring_parser *formatstring_parser1; struct formatstring_parser *formatstring_parser2; }; + typedef struct table_ty table_ty; static table_ty table[] = { @@ -2130,12 +2130,12 @@ language_to_extractor (const char *name) static const char * extension_to_language (const char *extension) { - typedef struct table_ty table_ty; struct table_ty { const char *extension; const char *language; }; + typedef struct table_ty table_ty; static table_ty table[] = {