changeset 13021:239c17119e60

Ensure no #include statements inside extern "C" { ... }.
author Bruno Haible <bruno@clisp.org>
date Sun, 21 Mar 2010 01:14:37 +0100
parents 0c8447d33973
children 63c614c3b5e9
files ChangeLog lib/obstack.h lib/time.in.h
diffstat 3 files changed, 20 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-20  Bruno Haible  <bruno@clisp.org>
+
+	Ensure no #include statements inside extern "C" { ... }.
+	* lib/obstack.h: Shrink extern "C" { ... } region so that it does not
+	contain #include statements.
+	* lib/time.in.h: Likewise.
+
 2010-03-20  Bruno Haible  <bruno@clisp.org>
 
 	Make _GL_WARN_ON_USE usable in C++ and C mode in the same compilation.
--- a/lib/obstack.h
+++ b/lib/obstack.h
@@ -103,10 +103,6 @@
 
 #ifndef _OBSTACK_H
 #define _OBSTACK_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
 
 /* We need the type of a pointer subtraction.  If __PTRDIFF_TYPE__ is
    defined, as with GNU C, use that; that way we don't pollute the
@@ -139,6 +135,10 @@
 
 #include <string.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct _obstack_chunk           /* Lives at front of each chunk. */
 {
   char  *limit;                 /* 1 past end of this chunk */
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -46,10 +46,6 @@
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
-# ifdef __cplusplus
-extern "C" {
-# endif
-
 /* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
    Or they define it with the wrong member names or define it in <sys/time.h>
    (e.g., FreeBSD circa 1997).  */
@@ -57,6 +53,11 @@
 #  if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 #   include <sys/time.h>
 #  else
+
+#   ifdef __cplusplus
+extern "C" {
+#   endif
+
 #   undef timespec
 #   define timespec rpl_timespec
 struct timespec
@@ -64,11 +65,12 @@
   time_t tv_sec;
   long int tv_nsec;
 };
-#  endif
-# endif
 
-# ifdef __cplusplus
+#   ifdef __cplusplus
 }
+#   endif
+
+#  endif
 # endif
 
 /* Sleep for at least RQTP seconds unless interrupted,  If interrupted,