Fix syntax errors in C++ mode.
[gnulib.git] / lib / glthread / thread.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 */