In C++ mode, there were many unclosed 'extern "C" {' lines (syntax error). Fixed as follows:
*** lib/glthread/cond.h.orig 2008-08-17 21:24:15.000000000 +0200 --- lib/glthread/cond.h 2008-08-17 21:24:03.000000000 +0200 *************** *** 140,145 **** --- 140,149 ---- # define glthread_cond_destroy(COND) \ (pthread_in_use () ? pthread_cond_destroy (COND) : 0) + # ifdef __cplusplus + } + # endif + #endif /* ========================================================================= */ *************** *** 195,200 **** --- 199,208 ---- # 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,258 **** --- 261,270 ---- # define glthread_cond_destroy(COND) \ (pthread_in_use () ? cond_destroy (COND) : 0) + # ifdef __cplusplus + } + # endif + #endif /* ========================================================================= */ *************** *** 277,282 **** --- 289,298 ---- /* Macros with built-in error handling. */ + #ifdef __cplusplus + extern "C" { + #endif + #define gl_cond_init(COND) \ do \ { \ *************** *** 325,328 **** --- 341,348 ---- } \ while (0) + #ifdef __cplusplus + } + #endif + #endif /* _GLTHREAD_COND_H */ *** lib/glthread/thread.h.orig 2008-08-17 21:24:15.000000000 +0200 --- lib/glthread/thread.h 2008-08-17 21:22:23.000000000 +0200 *************** *** 156,161 **** --- 156,165 ---- # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 # endif + # ifdef __cplusplus + } + # endif + #endif /* ========================================================================= */ *************** *** 203,208 **** --- 207,216 ---- (pth_in_use () ? pth_exit (RETVAL) : 0) # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 + # ifdef __cplusplus + } + # endif + #endif /* ========================================================================= */ *************** *** 250,257 **** # define gl_thread_exit(RETVAL) \ (pthread_in_use () ? thr_exit (RETVAL) : 0) # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 - #endif /* ========================================================================= */ --- 258,269 ---- # 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 /* ========================================================================= */ *************** *** 269,279 **** #endif - /* ========================================================================= */ /* Macros with built-in error handling. */ static inline gl_thread_t gl_thread_create (void *(*func) (void *arg), void *arg) { --- 281,294 ---- #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,310 **** --- 322,329 ---- } \ while (0) + #ifdef __cplusplus + } + #endif + #endif /* _GLTHREAD_THREAD_H */ *** lib/glthread/yield.h.orig 2008-08-17 21:24:15.000000000 +0200 --- lib/glthread/yield.h 2008-08-17 21:23:05.000000000 +0200 *************** *** 39,44 **** --- 39,48 ---- # define gl_thread_yield() \ sched_yield () + # ifdef __cplusplus + } + # endif + #endif /* ========================================================================= */ *************** *** 56,61 **** --- 60,69 ---- # define gl_thread_yield() \ pth_yield (NULL) + # ifdef __cplusplus + } + # endif + #endif /* ========================================================================= */ *************** *** 74,79 **** --- 82,91 ---- # define gl_thread_yield() \ thr_yield () + # ifdef __cplusplus + } + # endif + #endif /* ========================================================================= */ *************** *** 87,92 **** --- 99,108 ---- # define gl_thread_yield() \ Sleep (0) + # ifdef __cplusplus + } + # endif + #endif /* ========================================================================= */