changeset 10331:d10548c1dd8b

Fix syntax errors in C++ mode.
author Bruno Haible <bruno@clisp.org>
date Sun, 17 Aug 2008 21:26:13 +0200
parents f4a133133dce
children 2cb0d301f0ec
files lib/glthread/cond.h lib/glthread/thread.h lib/glthread/yield.h
diffstat 3 files changed, 57 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/glthread/cond.h	Sun Aug 17 21:18:02 2008 +0200
+++ b/lib/glthread/cond.h	Sun Aug 17 21:26:13 2008 +0200
@@ -140,6 +140,10 @@
 # define glthread_cond_destroy(COND) \
     (pthread_in_use () ? pthread_cond_destroy (COND) : 0)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -195,6 +199,10 @@
 # define glthread_cond_destroy(COND) 0
 extern int glthread_cond_timedwait_multithreaded (gl_cond_t *cond, gl_lock_t *lock, struct timespec *abstime);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -253,6 +261,10 @@
 # define glthread_cond_destroy(COND) \
     (pthread_in_use () ? cond_destroy (COND) : 0)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -277,6 +289,10 @@
 
 /* Macros with built-in error handling.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define gl_cond_init(COND)             \
    do                                  \
      {                                 \
@@ -325,4 +341,8 @@
      }                                    \
    while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GLTHREAD_COND_H */
--- a/lib/glthread/thread.h	Sun Aug 17 21:18:02 2008 +0200
+++ b/lib/glthread/thread.h	Sun Aug 17 21:26:13 2008 +0200
@@ -156,6 +156,10 @@
 #  define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
 # endif
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -203,6 +207,10 @@
     (pth_in_use () ? pth_exit (RETVAL) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -250,9 +258,13 @@
 # define gl_thread_exit(RETVAL) \
     (pthread_in_use () ? thr_exit (RETVAL) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
+
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
-
 /* ========================================================================= */
 
 #if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS)
@@ -269,11 +281,14 @@
 
 #endif
 
-
 /* ========================================================================= */
 
 /* Macros with built-in error handling.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 static inline gl_thread_t
 gl_thread_create (void *(*func) (void *arg), void *arg)
 {
@@ -307,4 +322,8 @@
      }                                               \
    while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GLTHREAD_THREAD_H */
--- a/lib/glthread/yield.h	Sun Aug 17 21:18:02 2008 +0200
+++ b/lib/glthread/yield.h	Sun Aug 17 21:26:13 2008 +0200
@@ -39,6 +39,10 @@
 # define gl_thread_yield() \
     sched_yield ()
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -56,6 +60,10 @@
 # define gl_thread_yield() \
     pth_yield (NULL)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -74,6 +82,10 @@
 # define gl_thread_yield() \
     thr_yield ()
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -87,6 +99,10 @@
 # define gl_thread_yield() \
     Sleep (0)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */