Mercurial > hg > octave-nkf > gnulib-hg
changeset 7529:cc0fde9eb167
Make it usable by a C++ compiler.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 19 Oct 2006 12:27:16 +0000 |
parents | 472795eea368 |
children | 16228468de35 |
files | ChangeLog lib/lock.h |
diffstat | 2 files changed, 37 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-10-18 Bruno Haible <bruno@clisp.org> + + * lib/lock.h [C++]: Wrap definitions in extern "C". + 2006-10-18 Bruno Haible <bruno@clisp.org> * gnulib-tool (func_emit_initmacro_end): Remove duplicates from the
--- 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 <pthread.h> # include <stdlib.h> +# 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 @@ while (0) extern int glthread_once_singlethreaded (pthread_once_t *once_control); +# ifdef __cplusplus +} +# endif + #endif /* ========================================================================= */ @@ -366,6 +374,10 @@ # include <pth.h> # include <stdlib.h> +# ifdef __cplusplus +extern "C" { +# endif + # if USE_PTH_THREADS_WEAK /* Use weak references to the GNU Pth threads library. */ @@ -468,6 +480,10 @@ 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 @@ # include <synch.h> # include <stdlib.h> +# ifdef __cplusplus +extern "C" { +# endif + # if USE_SOLARIS_THREADS_WEAK /* Use weak references to the old Solaris threads library. */ @@ -600,6 +620,10 @@ 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 @@ # include <windows.h> +# 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 @@ glthread_once (&NAME, INITFUNCTION) extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void)); +# ifdef __cplusplus +} +# endif + #endif /* ========================================================================= */