[Mesa-dev] [PATCH] gallium/auxiliary: Extern "c" fixes.

Alexander von Gluck IV kallisti5 at unixzen.com
Fri Jul 27 20:20:32 UTC 2018


Used by C++ code such as Haiku's renderer.
---
 src/gallium/auxiliary/driver_ddebug/dd_public.h          | 8 ++++++++
 src/gallium/auxiliary/driver_noop/noop_public.h          | 8 ++++++++
 .../auxiliary/target-helpers/inline_debug_helper.h       | 9 ++++++++-
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/driver_ddebug/dd_public.h b/src/gallium/auxiliary/driver_ddebug/dd_public.h
index e660765575..31c139d6a1 100644
--- a/src/gallium/auxiliary/driver_ddebug/dd_public.h
+++ b/src/gallium/auxiliary/driver_ddebug/dd_public.h
@@ -30,7 +30,15 @@
 
 struct pipe_screen;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct pipe_screen *
 ddebug_screen_create(struct pipe_screen *screen);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* DD_PUBLIC_H_ */
diff --git a/src/gallium/auxiliary/driver_noop/noop_public.h b/src/gallium/auxiliary/driver_noop/noop_public.h
index 180ea597fa..46a7f4084f 100644
--- a/src/gallium/auxiliary/driver_noop/noop_public.h
+++ b/src/gallium/auxiliary/driver_noop/noop_public.h
@@ -23,7 +23,15 @@
 #ifndef NOOP_PUBLIC_H
 #define NOOP_PUBLIC_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct pipe_screen;
 struct pipe_screen *noop_screen_create(struct pipe_screen *screen);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/src/gallium/auxiliary/target-helpers/inline_debug_helper.h b/src/gallium/auxiliary/target-helpers/inline_debug_helper.h
index 66d46de888..15659896b6 100644
--- a/src/gallium/auxiliary/target-helpers/inline_debug_helper.h
+++ b/src/gallium/auxiliary/target-helpers/inline_debug_helper.h
@@ -6,7 +6,6 @@
 #include "util/u_debug.h"
 #include "util/u_tests.h"
 
-
 /* Helper function to wrap a screen with
  * one or more debug drivers.
  */
@@ -16,6 +15,10 @@
 #include "driver_rbug/rbug_public.h"
 #include "driver_noop/noop_public.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * TODO: Audit the following *screen_create() - all of
  * them should return the original screen on failuire.
@@ -35,3 +38,7 @@ debug_screen_wrap(struct pipe_screen *screen)
 }
 
 #endif
+
+#ifdef __cplusplus
+}
+#endif
-- 
2.17.1



More information about the mesa-dev mailing list