Fix syntax errors in C++ mode.
authorBruno Haible <bruno@clisp.org>
Sun, 17 Aug 2008 19:26:13 +0000 (21:26 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 17 Aug 2008 19:26:13 +0000 (21:26 +0200)
lib/glthread/cond.h
lib/glthread/thread.h
lib/glthread/yield.h

index 2fb7df5..f71e627 100644 (file)
@@ -140,6 +140,10 @@ typedef pthread_cond_t gl_cond_t;
 # define glthread_cond_destroy(COND) \
     (pthread_in_use () ? pthread_cond_destroy (COND) : 0)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -195,6 +199,10 @@ typedef pth_cond_t gl_cond_t;
 # 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 @@ typedef pthread_cond_t gl_cond_t;
 # define glthread_cond_destroy(COND) \
     (pthread_in_use () ? cond_destroy (COND) : 0)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -277,6 +289,10 @@ typedef int gl_cond_t;
 
 /* Macros with built-in error handling.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define gl_cond_init(COND)             \
    do                                  \
      {                                 \
@@ -325,4 +341,8 @@ gl_cond_timedwait_func (gl_cond_t *cond, gl_lock_t *lock, struct timespec *absti
      }                                    \
    while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GLTHREAD_COND_H */
index bd8575f..5c98cdd 100644 (file)
@@ -156,6 +156,10 @@ typedef pthread_t gl_thread_t;
 #  define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
 # endif
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -203,6 +207,10 @@ typedef pth_t gl_thread_t;
     (pth_in_use () ? pth_exit (RETVAL) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -250,8 +258,12 @@ typedef thread_t gl_thread_t;
 # define gl_thread_exit(RETVAL) \
     (pthread_in_use () ? thr_exit (RETVAL) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
-#endif
 
+# ifdef __cplusplus
+}
+# endif
+
+#endif
 
 /* ========================================================================= */
 
@@ -269,11 +281,14 @@ typedef int gl_thread_t;
 
 #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 @@ gl_thread_create (void *(*func) (void *arg), void *arg)
      }                                               \
    while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GLTHREAD_THREAD_H */
index 80cfb88..f208313 100644 (file)
@@ -39,6 +39,10 @@ extern "C" {
 # define gl_thread_yield() \
     sched_yield ()
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -56,6 +60,10 @@ extern "C" {
 # define gl_thread_yield() \
     pth_yield (NULL)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -74,6 +82,10 @@ extern "C" {
 # define gl_thread_yield() \
     thr_yield ()
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -87,6 +99,10 @@ extern "C" {
 # define gl_thread_yield() \
     Sleep (0)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */