From a107e556dc4fbe4023574f9026512bfef7e0e531 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 19 Oct 2006 12:27:16 +0000 Subject: [PATCH] Make it usable by a C++ compiler. --- ChangeLog | 4 ++++ lib/lock.h | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a819648cd..d29128f95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-18 Bruno Haible + * lib/lock.h [C++]: Wrap definitions in extern "C". + +2006-10-18 Bruno Haible + * gnulib-tool (func_emit_initmacro_end): Remove duplicates from the gl_LIBOBJS list. diff --git a/lib/lock.h b/lib/lock.h index 7f2cfc4b9..e6b312af5 100644 --- a/lib/lock.h +++ b/lib/lock.h @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,6 +70,10 @@ # include # include +# ifdef __cplusplus +extern "C" { +# endif + # if PTHREAD_IN_USE_DETECTION_HARD /* The pthread_in_use() detection needs to be done at runtime. */ @@ -355,6 +359,10 @@ typedef pthread_once_t gl_once_t; while (0) extern int glthread_once_singlethreaded (pthread_once_t *once_control); +# ifdef __cplusplus +} +# endif + #endif /* ========================================================================= */ @@ -366,6 +374,10 @@ extern int glthread_once_singlethreaded (pthread_once_t *once_control); # include # include +# ifdef __cplusplus +extern "C" { +# endif + # if USE_PTH_THREADS_WEAK /* Use weak references to the GNU Pth threads library. */ @@ -468,6 +480,10 @@ typedef pth_once_t gl_once_t; extern void glthread_once_call (void *arg); extern int glthread_once_singlethreaded (pth_once_t *once_control); +# ifdef __cplusplus +} +# endif + #endif /* ========================================================================= */ @@ -480,6 +496,10 @@ extern int glthread_once_singlethreaded (pth_once_t *once_control); # include # include +# ifdef __cplusplus +extern "C" { +# endif + # if USE_SOLARIS_THREADS_WEAK /* Use weak references to the old Solaris threads library. */ @@ -600,6 +620,10 @@ typedef struct extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void)); extern int glthread_once_singlethreaded (gl_once_t *once_control); +# ifdef __cplusplus +} +# endif + #endif /* ========================================================================= */ @@ -608,6 +632,10 @@ extern int glthread_once_singlethreaded (gl_once_t *once_control); # include +# ifdef __cplusplus +extern "C" { +# endif + /* We can use CRITICAL_SECTION directly, rather than the Win32 Event, Mutex, Semaphore types, because - we need only to synchronize inside a single process (address space), @@ -741,6 +769,10 @@ typedef struct glthread_once (&NAME, INITFUNCTION) extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void)); +# ifdef __cplusplus +} +# endif + #endif /* ========================================================================= */ -- 2.11.0