fix: warnings on non-Linux platforms
[urcu.git] / src / urcu-bp.c
index 54fda1650e4f813694886d3eca64e708b93eb76f..671becb0e14644c6eeb37270ab154f1b95877549 100644 (file)
@@ -23,6 +23,7 @@
  * IBM's contributions to this file may be relicensed under LGPLv2 or later.
  */
 
  * IBM's contributions to this file may be relicensed under LGPLv2 or later.
  */
 
+#define URCU_NO_COMPAT_IDENTIFIERS
 #define _LGPL_SOURCE
 #include <stdio.h>
 #include <pthread.h>
 #define _LGPL_SOURCE
 #include <stdio.h>
 #include <pthread.h>
@@ -36,6 +37,7 @@
 #include <stdbool.h>
 #include <sys/mman.h>
 
 #include <stdbool.h>
 #include <sys/mman.h>
 
+#include <urcu/config.h>
 #include <urcu/arch.h>
 #include <urcu/wfcqueue.h>
 #include <urcu/map/urcu-bp.h>
 #include <urcu/arch.h>
 #include <urcu/wfcqueue.h>
 #include <urcu/map/urcu-bp.h>
@@ -73,8 +75,10 @@ void *mremap_wrapper(void *old_address, size_t old_size,
  * This is not generic.
 */
 static
  * This is not generic.
 */
 static
-void *mremap_wrapper(void *old_address, size_t old_size,
-               size_t new_size, int flags)
+void *mremap_wrapper(void *old_address __attribute__((unused)),
+               size_t old_size __attribute__((unused)),
+               size_t new_size __attribute__((unused)),
+               int flags)
 {
        assert(!(flags & MREMAP_MAYMOVE));
 
 {
        assert(!(flags & MREMAP_MAYMOVE));
 
@@ -565,6 +569,12 @@ end:
 }
 URCU_ATTR_ALIAS("urcu_bp_register") void rcu_bp_register();
 
 }
 URCU_ATTR_ALIAS("urcu_bp_register") void rcu_bp_register();
 
+void urcu_bp_register_thread(void)
+{
+       if (caa_unlikely(!URCU_TLS(urcu_bp_reader)))
+               urcu_bp_register(); /* If not yet registered. */
+}
+
 /* Disable signals, take mutex, remove from registry */
 static
 void urcu_bp_unregister(struct rcu_reader *rcu_reader_reg)
 /* Disable signals, take mutex, remove from registry */
 static
 void urcu_bp_unregister(struct rcu_reader *rcu_reader_reg)
This page took 0.027332 seconds and 4 git commands to generate.