radeonsi: allow including a few files from C++
authorMarek Olšák <marek.olsak@amd.com>
Wed, 26 Aug 2020 02:50:30 +0000 (22:50 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 9 Dec 2020 21:01:21 +0000 (16:01 -0500)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7807>

src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_pm4.h
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state.h

index f719415..4602afb 100644 (file)
 #include "util/u_suballoc.h"
 #include "util/u_threaded_context.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if UTIL_ARCH_BIG_ENDIAN
 #define SI_BIG_ENDIAN 1
 #else
@@ -1916,4 +1920,8 @@ struct pipe_resource *si_buffer_from_winsys_buffer(struct pipe_screen *screen,
                                                    struct pb_buffer *imported_buf,
                                                    bool dedicated);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index f8edea4..06909ff 100644 (file)
 
 #include "radeon/radeon_winsys.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define SI_PM4_MAX_DW 176
 
 // forward defines
@@ -63,4 +67,8 @@ void si_pm4_free_state(struct si_context *sctx, struct si_pm4_state *state, unsi
 void si_pm4_emit(struct si_context *sctx, struct si_pm4_state *state);
 void si_pm4_reset_emitted(struct si_context *sctx, bool first_cs);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index c31c5ae..a0b6692 100644 (file)
 
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 // Use LDS symbols when supported by LLVM. Can be disabled for testing the old
 // path on newer LLVM for now. Should be removed in the long term.
 #define USE_LDS_SYMBOLS (true)
@@ -910,4 +914,8 @@ static inline bool si_shader_uses_bindless_images(struct si_shader_selector *sel
    return selector ? selector->info.uses_bindless_images : false;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 1d94d8c..2db7c5b 100644 (file)
 #include "si_pm4.h"
 #include "util/u_blitter.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define SI_NUM_GRAPHICS_SHADERS (PIPE_SHADER_TESS_EVAL + 1)
 #define SI_NUM_SHADERS          (PIPE_SHADER_COMPUTE + 1)
 
@@ -628,4 +632,8 @@ static inline unsigned si_get_image_slot(unsigned slot)
    return SI_NUM_IMAGE_SLOTS - 1 - slot;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif