Add extern "C" to support linking userspace RCU library with C++ applications
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 7 Dec 2009 14:39:20 +0000 (09:39 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 7 Dec 2009 14:39:20 +0000 (09:39 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
19 files changed:
urcu-bp-static.h
urcu-bp.h
urcu-defer-static.h
urcu-defer.h
urcu-pointer-static.h
urcu-pointer.h
urcu-qsbr-static.h
urcu-qsbr.h
urcu-static.h
urcu.h
urcu/arch_ppc.h
urcu/arch_s390.h
urcu/arch_sparc64.h
urcu/arch_x86.h
urcu/uatomic_arch_ppc.h
urcu/uatomic_arch_s390.h
urcu/uatomic_arch_sparc64.h
urcu/uatomic_arch_x86.h
urcu/urcu-futex.h

index ff16fd4712ff3e669fbb9420c4f5364087c9c701..7db2df6fcb7723c833dd7423c2d2e508efb83fb6 100644 (file)
  * This is required to permit relinking with newer versions of the library.
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Active attempts to check for reader Q.S. before calling sleep().
  */
@@ -194,4 +198,8 @@ static inline void _rcu_read_unlock(void)
        _STORE_SHARED(urcu_reader->ctr, urcu_reader->ctr - RCU_GP_COUNT);
 }
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_BP_STATIC_H */
index d42a2cb24f0739f5bd6cef39328775b106cecace..c0a419f99a1a54813cd8f3a5314e43fec5b80c87 100644 (file)
--- a/urcu-bp.h
+++ b/urcu-bp.h
  */
 #include <urcu-pointer.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Important !
  *
@@ -97,4 +101,8 @@ static inline void urcu_init(void)
 {
 }
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_BP_H */
index b27cfe156b6c99d3dc8ec0ef4a14540601632a21..8575195a50b4d6530f4c56e7975d49567d4decca 100644 (file)
@@ -37,6 +37,9 @@
 #include <urcu/uatomic_arch.h>
 #include <urcu/list.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*
  * Number of entries in the per-thread defer queue. Must be power of 2.
@@ -127,4 +130,8 @@ struct defer_queue {
        struct list_head list;  /* list of thread queues */
 };
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_DEFER_STATIC_H */
index 00f18ff47af3177c205006139fbc00850d12b446..b7fe8bfda53b921844c2abde703a446a5c662407 100644 (file)
 #include <stdlib.h>
 #include <pthread.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Note: the defer_rcu() API is currently EXPERIMENTAL. It may change in the
  * future.
@@ -64,4 +68,8 @@ extern void rcu_defer_unregister_thread(void);
 extern void rcu_defer_barrier(void);
 extern void rcu_defer_barrier_thread(void);
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_BATCH_H */
index eb073afa18683c5a6d1a626397aef70a21678d2c..093630a084f84ba7c5917a5621ee3fe1de3af258 100644 (file)
 #include <urcu/system.h>
 #include <urcu/uatomic_arch.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 /**
  * _rcu_dereference - reads (copy) a RCU-protected pointer to a local variable
  * into a RCU read-side critical section. The pointer can later be safely
 
 #define _rcu_assign_pointer(p, v)      _rcu_set_pointer(&(p), v)
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_POINTER_STATIC_H */
index 948ac423f667b1810f1fccc3b77b40126a428ff1..487abab4abd8c1d16a87b5486e714413639d6ca2 100644 (file)
 #include <urcu/arch.h>
 #include <urcu/uatomic_arch.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #ifdef _LGPL_SOURCE
 
 #include <urcu-pointer-static.h>
@@ -107,4 +111,8 @@ extern void *rcu_set_pointer_sym(void **p, void *v);
  */
 #define rcu_assign_pointer(p, v)       rcu_set_pointer((&p), (v))
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_POINTER_H */
index e49a04186104bbc2b3b769665a1fb6cb59fe7911..72d35957e802c42733ed415d871a9c4aa54a74ac 100644 (file)
 #include <urcu/list.h>
 #include <urcu/urcu-futex.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 /*
  * This code section can only be included in LGPL 2.1 compatible source code.
  * See below for the function call wrappers which can be used in code meant to
@@ -210,4 +214,8 @@ static inline void _rcu_thread_online(void)
        smp_mb();
 }
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_QSBR_STATIC_H */
index 21c2a2e0c9bf299804c4d6a40aa31a13e41d5186..8e6f1e463a7907075e1c76d4a6df370533e0b268 100644 (file)
  */
 #include <urcu-pointer.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 /*
  * Important !
  *
@@ -114,4 +118,8 @@ extern void synchronize_rcu(void);
 extern void rcu_register_thread(void);
 extern void rcu_unregister_thread(void);
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_QSBR_H */
index 97d94dc0b8817b5a87e83fafb3de9d3c6bd011b1..dec8a204166d2f2c9848227a7629c53057164958 100644 (file)
 #include <urcu/list.h>
 #include <urcu/urcu-futex.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 /*
  * This code section can only be included in LGPL 2.1 compatible source code.
  * See below for the function call wrappers which can be used in code meant to
@@ -237,4 +241,8 @@ static inline void _rcu_read_unlock(void)
        }
 }
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_STATIC_H */
diff --git a/urcu.h b/urcu.h
index 69c06e409ddaf2bb95d96d27ae6d9369b777d40b..da0b295ba9d72ec21c4ea1f3291f22ad669665b2 100644 (file)
--- a/urcu.h
+++ b/urcu.h
  */
 #include <urcu-pointer.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 /*
  * Important !
  *
@@ -92,4 +96,8 @@ extern void rcu_unregister_thread(void);
  */
 extern void urcu_init(void);
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_H */
index 12b018eef7d90276524d56e8606ab3786e615a0b..49d844b617aafced769b48b3fddd57c5b3106e85 100644 (file)
 #include <urcu/compiler.h>
 #include <urcu/config.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #define CONFIG_HAVE_MEM_COHERENCY
 
 /* Include size of POWER5+ L3 cache lines: 256 bytes */
@@ -115,4 +119,8 @@ static inline cycles_t get_cycles (void)
        }
 }
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_ARCH_PPC_H */
index 9d3d452b961b3dd3e74a99147a2b6012688685d0..b400376a30089ffa936ad104dca88568cb3f901d 100644 (file)
 #include <compiler.h>
 #include <urcu/config.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #define CONFIG_HAVE_MEM_COHERENCY
 
 #define CACHE_LINE_SIZE        128
@@ -94,4 +98,8 @@ static inline cycles_t get_cycles (void)
        return cycles;
 }
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_ARCH_S390_H */
index a260e3a39abb29b94124cf838dd137a9be234849..6dcb90810f75874e35dc3f63db93b17d7a8bf027 100644 (file)
 #include <urcu/compiler.h>
 #include <urcu/config.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #define CONFIG_HAVE_MEM_COHERENCY
 
 #define CACHE_LINE_SIZE        256
@@ -100,4 +104,8 @@ static inline cycles_t get_cycles (void)
        return 0;       /* unimplemented */
 }
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_ARCH_SPARC64_H */
index f137a16d841c48e3c663a645286137ffe2114a04..b3f29625142490530b3a813186bb094b069abdb5 100644 (file)
 #include <urcu/compiler.h>
 #include <urcu/config.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #define CONFIG_HAVE_MEM_COHERENCY
 
 #define CACHE_LINE_SIZE        128
@@ -125,4 +129,8 @@ static inline cycles_t get_cycles(void)
         return ret;
 }
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_ARCH_X86_H */
index a32c789b94ea885619c9af4e18a13741809217d6..b732b08c42389a465db3b72d8b18386357dd120f 100644 (file)
 #include <urcu/compiler.h>
 #include <urcu/system.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #ifndef __SIZEOF_LONG__
 #ifdef __powerpc64__
 #define __SIZEOF_LONG__ 8
@@ -227,4 +231,8 @@ unsigned long _uatomic_add_return(void *addr, unsigned long val,
 
 #define compat_uatomic_cmpxchg(ptr, old, _new) uatomic_cmpxchg(ptr, old, _new)
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_ARCH_UATOMIC_PPC_H */
index ab7e9427613cc4f2926e3f4f0cfa98b5007152ef..813d9708a8efff783938a24c3e55987c64042436 100644 (file)
 #include <urcu/compiler.h>
 #include <urcu/system.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #ifndef __SIZEOF_LONG__
 #ifdef __s390x__
 #define __SIZEOF_LONG__ 8
@@ -216,4 +220,8 @@ unsigned long _uatomic_add_return(void *addr, unsigned long val, int len)
 
 #define compat_uatomic_cmpxchg(ptr, old, _new) uatomic_cmpxchg(ptr, old, _new)
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_UATOMIC_ARCH_S390_H */
index 622fe100e8f47627b3232acd67dbe5e27bef2e80..3aa3b7d9afb889b7f7cd8df80445148dc2dc523b 100644 (file)
 #include <urcu/compiler.h>
 #include <urcu/system.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #ifndef __SIZEOF_LONG__
 #ifdef __LP64__
 #define __SIZEOF_LONG__ 8
@@ -177,4 +181,8 @@ unsigned long _uatomic_add_return(void *addr, unsigned long val, int len)
 
 #define compat_uatomic_cmpxchg(ptr, old, _new) uatomic_cmpxchg(ptr, old, _new)
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_ARCH_UATOMIC_PPC_H */
index 8e0f0a80e67eba76e9a30d4d709e8cc10a42c70a..b57569877a05a9e126f5dab037e3ca99cdb77f45 100644 (file)
 #include <urcu/compiler.h>
 #include <urcu/system.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #ifndef __SIZEOF_LONG__
 #if defined(__x86_64__) || defined(__amd64__)
 #define __SIZEOF_LONG__ 8
@@ -478,4 +482,8 @@ extern unsigned long _compat_uatomic_xchg(void *addr,
 #define uatomic_inc(addr)      UATOMIC_COMPAT(inc(addr))
 #define uatomic_dec(addr)      UATOMIC_COMPAT(dec(addr))
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_ARCH_UATOMIC_X86_H */
index 14fb5c0b58e5444dc584d6668e3e233d3de7fe89..95598ad14ccafccebc0615f1ddc6803bf328a34c 100644 (file)
 
 #include <urcu/config.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 #define FUTEX_WAIT             0
 #define FUTEX_WAKE             1
 
@@ -55,4 +59,8 @@ extern int compat_futex_async(int *uaddr, int op, int val,
                compat_futex_async(uaddr, op, val, timeout, uaddr2, val3)
 #endif
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_FUTEX_H */
This page took 0.032582 seconds and 4 git commands to generate.