summaryrefslogtreecommitdiffstats
path: root/src/util
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/util
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/util')
-rw-r--r--src/util/Makefile.am3
-rw-r--r--src/util/register_allocate.h10
2 files changed, 13 insertions, 0 deletions
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 29b66e70e9d..ec49dc6cf16 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -25,6 +25,9 @@ include Makefile.sources
noinst_LTLIBRARIES = libmesautil.la
+AM_CPPFLAGS = \
+ -I$(top_srcdir)/include
+
libmesautil_la_CPPFLAGS = \
$(DEFINES) \
-I$(top_srcdir)/include \
diff --git a/src/util/register_allocate.h b/src/util/register_allocate.h
index dc687449532..61f182eff49 100644
--- a/src/util/register_allocate.h
+++ b/src/util/register_allocate.h
@@ -27,6 +27,12 @@
#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct ra_class;
struct ra_regs;
@@ -77,3 +83,7 @@ void ra_set_node_spill_cost(struct ra_graph *g, unsigned int n, float cost);
int ra_get_best_spill_node(struct ra_graph *g);
/** @} */
+
+#ifdef __cplusplus
+} // extern "C"
+#endif