summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMark Janes <[email protected]>2015-03-04 16:37:29 -0800
committerMatt Turner <[email protected]>2015-03-05 10:21:40 -0800
commit237dcb4aa7c39c59bfd225ae3d73caf709be216d (patch)
tree9139b596ac2383fa3e4ada351b94000ba9319e5f /src/gallium
parent2e4c95dfe2cb205c327ceaa12b44a9273bdb20dc (diff)
Fix invalid extern "C" around header inclusion.
System headers may contain C++ declarations, which cannot be given C linkage. For this reason, include statements should never occur inside extern "C". This patch moves the C linkage statements to enclose only the declarations within a single header. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_math.h11
-rw-r--r--src/gallium/drivers/r600/r600_shader.h12
-rw-r--r--src/gallium/drivers/r600/sb/sb_bc.h2
-rw-r--r--src/gallium/drivers/r600/sb/sb_bc_parser.cpp2
-rw-r--r--src/gallium/drivers/r600/sb/sb_core.cpp2
-rw-r--r--src/gallium/drivers/r600/sb/sb_public.h12
6 files changed, 29 insertions, 12 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 5400fcead59..8f62cac664e 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -41,12 +41,6 @@
#include "pipe/p_compiler.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
#include "c99_math.h"
#include <float.h>
#include <stdarg.h>
@@ -56,6 +50,11 @@ extern "C" {
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#ifndef M_SQRT2
#define M_SQRT2 1.41421356237309504880
#endif
diff --git a/src/gallium/drivers/r600/r600_shader.h b/src/gallium/drivers/r600/r600_shader.h
index b2559e9b661..dd359d7e959 100644
--- a/src/gallium/drivers/r600/r600_shader.h
+++ b/src/gallium/drivers/r600/r600_shader.h
@@ -25,6 +25,12 @@
#include "r600_asm.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct r600_shader_io {
unsigned name;
unsigned gpr;
@@ -125,4 +131,10 @@ struct r600_pipe_shader {
TGSI_INTERPOLATE_LOC_CENTER/SAMPLE/COUNT. Other input values return -1. */
int eg_get_interpolator_index(unsigned interpolate, unsigned location);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+
#endif
diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h
index 072d8f8b4e0..ab988f8716d 100644
--- a/src/gallium/drivers/r600/sb/sb_bc.h
+++ b/src/gallium/drivers/r600/sb/sb_bc.h
@@ -27,10 +27,8 @@
#ifndef SB_BC_H_
#define SB_BC_H_
-extern "C" {
#include <stdint.h>
#include "r600_isa.h"
-}
#include <cstdio>
#include <string>
diff --git a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
index 403f938092e..08e7f5c36c3 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
@@ -32,10 +32,8 @@
#define BCP_DUMP(q)
#endif
-extern "C" {
#include "r600_pipe.h"
#include "r600_shader.h"
-}
#include <stack>
diff --git a/src/gallium/drivers/r600/sb/sb_core.cpp b/src/gallium/drivers/r600/sb/sb_core.cpp
index 9fd9d9ad25a..7db80082b60 100644
--- a/src/gallium/drivers/r600/sb/sb_core.cpp
+++ b/src/gallium/drivers/r600/sb/sb_core.cpp
@@ -26,13 +26,11 @@
#define SB_RA_SCHED_CHECK DEBUG
-extern "C" {
#include "os/os_time.h"
#include "r600_pipe.h"
#include "r600_shader.h"
#include "sb_public.h"
-}
#include <stack>
#include <map>
diff --git a/src/gallium/drivers/r600/sb/sb_public.h b/src/gallium/drivers/r600/sb/sb_public.h
index c9f5f97f9c8..a90771f06d1 100644
--- a/src/gallium/drivers/r600/sb/sb_public.h
+++ b/src/gallium/drivers/r600/sb/sb_public.h
@@ -27,6 +27,12 @@
#ifndef R600_SB_H_
#define R600_SB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct r600_shader;
void r600_sb_context_destroy(void *sctx);
@@ -37,4 +43,10 @@ int r600_sb_bytecode_process(struct r600_context *rctx,
int dump_source_bytecode,
int optimize);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+
#endif //R600_SB_H_