]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make it compile in C++ mode as well.
authorBruno Haible <bruno@clisp.org>
Fri, 24 Oct 2003 10:23:02 +0000 (10:23 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:06 +0000 (12:11 +0200)
gettext-tools/lib/ChangeLog
gettext-tools/lib/hash.h
gettext-tools/src/ChangeLog
gettext-tools/src/msgfilter.c
gettext-tools/src/xgettext.c

index 94982caf0a7e8d2484511b6824093faa61e691c3..3e15fa353d22187b7999fcb7cfad8ff7e5f899ff 100644 (file)
@@ -1,3 +1,7 @@
+2003-10-14  Bruno Haible  <bruno@clisp.org>
+
+       * hash.h: Make it includable in C++ mode.
+
 2003-10-21  Bruno Haible  <bruno@clisp.org>
 
        * canonicalize.c (lstat): Define as an alias to 'stat' on systems
index 10e512c9d9e0705c951e9d23b302cf130f3614f6..07b1de4612f22bf484efc066b0cd8e363b92f99e 100644 (file)
@@ -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
    - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifndef _HASH_H
-# define _HASH_H
+#define _HASH_H
 
-# include <obstack.h>
+#include <obstack.h>
+
+#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 */
index 4698ba38a9bdfc663e0795fb0546963041d37284..496c6c7998c846359aad1dec1cb6e099be2443e6 100644 (file)
@@ -1,3 +1,10 @@
+2003-10-14  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        Support CR/LF line terminators in C sources even on Unix.
index 88b6ed0cd05a06a552006fb5a00496f0c77061dc..e7b418c501ce381fc12a2c0fa506fd490707b666 100644 (file)
@@ -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);
index 1e3f4e7fbd9fe320c3b4cbdd3a222b5a5211680a..ae3d3f814c146ee71519024427cbd3abc376a4f9 100644 (file)
@@ -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[] =
   {