[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make 'lock' usable in a mixed C/C++ world
From: |
Bruno Haible |
Subject: |
make 'lock' usable in a mixed C/C++ world |
Date: |
Thu, 19 Oct 2006 14:24:04 +0200 |
User-agent: |
KMail/1.9.1 |
The mingw port of GNU gettext now needs this.
2006-10-18 Bruno Haible <address@hidden>
* lock.h [C++]: Wrap definitions in extern "C".
*** gnulib-20061012/lib/lock.h 2006-08-15 13:35:30.000000000 +0200
--- gnulib-20061012-modified/lib/lock.h 2006-10-19 04:41:44.000000000 +0200
***************
*** 1,5 ****
/* Locking in multithreaded situations.
! Copyright (C) 2005 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
--- 1,5 ----
/* Locking in multithreaded situations.
! 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,75 ****
--- 70,79 ----
# 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,360 ****
--- 359,368 ----
while (0)
extern int glthread_once_singlethreaded (pthread_once_t *once_control);
+ # ifdef __cplusplus
+ }
+ # endif
+
#endif
/* =========================================================================
*/
***************
*** 366,371 ****
--- 374,383 ----
# 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,473 ****
--- 480,489 ----
extern void glthread_once_call (void *arg);
extern int glthread_once_singlethreaded (pth_once_t *once_control);
+ # ifdef __cplusplus
+ }
+ # endif
+
#endif
/* =========================================================================
*/
***************
*** 480,485 ****
--- 496,505 ----
# 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,605 ****
--- 620,629 ----
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,613 ****
--- 632,641 ----
# 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,746 ****
--- 769,778 ----
glthread_once (&NAME, INITFUNCTION)
extern void glthread_once (gl_once_t *once_control, void (*initfunction)
(void));
+ # ifdef __cplusplus
+ }
+ # endif
+
#endif
/* =========================================================================
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- make 'lock' usable in a mixed C/C++ world,
Bruno Haible <=