Index: uspace/lib/c/include/fibril_synch.h
===================================================================
--- uspace/lib/c/include/fibril_synch.h	(revision 4805495a910f793f8918c13f029a38a5bb548154)
+++ uspace/lib/c/include/fibril_synch.h	(revision a3f63ac154a8851b99a2cdc01fb73050f4b9ca43)
@@ -40,10 +40,7 @@
 #include <time.h>
 #include <stdbool.h>
-
-typedef struct {
-	fibril_owner_info_t oi;  /**< Keep this the first thing. */
-	int counter;
-	list_t waiters;
-} fibril_mutex_t;
+#include <_bits/decls.h>
+
+#ifndef __cplusplus
 
 #define FIBRIL_MUTEX_INITIALIZER(name) \
@@ -58,11 +55,4 @@
 #define FIBRIL_MUTEX_INITIALIZE(name) \
 	fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name)
-
-typedef struct {
-	fibril_owner_info_t oi;  /**< Keep this the first thing. */
-	unsigned int writers;
-	unsigned int readers;
-	list_t waiters;
-} fibril_rwlock_t;
 
 #define FIBRIL_RWLOCK_INITIALIZER(name) \
@@ -79,8 +69,4 @@
 	fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name)
 
-typedef struct {
-	list_t waiters;
-} fibril_condvar_t;
-
 #define FIBRIL_CONDVAR_INITIALIZER(name) \
 	{ \
@@ -90,4 +76,34 @@
 #define FIBRIL_CONDVAR_INITIALIZE(name) \
 	fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name)
+
+#define FIBRIL_SEMAPHORE_INITIALIZER(name, cnt) \
+	{ \
+		.count = (cnt), \
+		.waiters = LIST_INITIALIZER((name).waiters), \
+	}
+
+#define FIBRIL_SEMAPHORE_INITIALIZE(name, cnt) \
+	fibril_semaphore_t name = FIBRIL_SEMAPHORE_INITIALIZER(name, cnt)
+
+#endif
+
+__HELENOS_DECLS_BEGIN;
+
+typedef struct {
+	fibril_owner_info_t oi;  /**< Keep this the first thing. */
+	int counter;
+	list_t waiters;
+} fibril_mutex_t;
+
+typedef struct {
+	fibril_owner_info_t oi;  /**< Keep this the first thing. */
+	unsigned int writers;
+	unsigned int readers;
+	list_t waiters;
+} fibril_rwlock_t;
+
+typedef struct {
+	list_t waiters;
+} fibril_condvar_t;
 
 typedef void (*fibril_timer_fun_t)(void *);
@@ -134,13 +150,4 @@
 } fibril_semaphore_t;
 
-#define FIBRIL_SEMAPHORE_INITIALIZER(name, cnt) \
-	{ \
-		.count = (cnt), \
-		.waiters = LIST_INITIALIZER((name).waiters), \
-	}
-
-#define FIBRIL_SEMAPHORE_INITIALIZE(name, cnt) \
-	fibril_semaphore_t name = FIBRIL_SEMAPHORE_INITIALIZER(name, cnt)
-
 extern void __fibril_synch_init(void);
 extern void __fibril_synch_fini(void);
@@ -190,4 +197,6 @@
 extern void mpsc_close(mpsc_t *);
 
+__HELENOS_DECLS_END;
+
 #endif
 
