git » libfiu » commit aec380c

libfiu: make headers usable from C++

author Tommi Rantala
2009-07-10 18:44:31 UTC
committer Alberto Bertogli
2009-07-13 17:10:02 UTC
parent ff8c06e87ebeee8438b8d634e902a57eba234cf3

libfiu: make headers usable from C++

Instruct C++ compilers not to mangle libfiu symbols.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>

libfiu/fiu-control.h +14 -0
libfiu/fiu.h +9 -0

diff --git a/libfiu/fiu-control.h b/libfiu/fiu-control.h
index c1859ee..30ed4f1 100644
--- a/libfiu/fiu-control.h
+++ b/libfiu/fiu-control.h
@@ -1,4 +1,11 @@
 
+#ifndef _FIU_CONTROL_H
+#define _FIU_CONTROL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Control API for libfiu
  */
@@ -66,3 +73,10 @@ int fiu_disable(const char *name);
  * - returns: 0 on success, -1 on errors. */
 int fiu_rc_fifo(const char *basename);
 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _FIU_CONTROL_H
+
diff --git a/libfiu/fiu.h b/libfiu/fiu.h
index 645c456..ea35cd6 100644
--- a/libfiu/fiu.h
+++ b/libfiu/fiu.h
@@ -15,6 +15,11 @@
 /* Controls whether the external code enables libfiu or not. */
 #ifdef FIU_ENABLE
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Initializes the library.
  *
  * - flags: unused.
@@ -50,6 +55,10 @@ void *fiu_failinfo(void);
 #define fiu_return_on(name, retval) fiu_do_on(name, return retval)
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #else
 /* fiu not enabled, this should match fiu-local.h but we don't include it
  * because it includes us assuming we're installed system-wide */