Mesa (master): util: Declare util_half_init_tables only once.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Apr 1 14:18:46 UTC 2010


Module: Mesa
Branch: master
Commit: 89034b8ae71ca12f9a12935807a33caa686ede00
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=89034b8ae71ca12f9a12935807a33caa686ede00

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Apr  1 15:15:28 2010 +0100

util: Declare util_half_init_tables only once.

---

 src/gallium/auxiliary/util/u_gctors.cpp |    2 +-
 src/gallium/auxiliary/util/u_half.c     |    3 ---
 src/gallium/auxiliary/util/u_half.h     |   14 ++++++++++++++
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_gctors.cpp b/src/gallium/auxiliary/util/u_gctors.cpp
index 9ea9819..3d2dc5b 100644
--- a/src/gallium/auxiliary/util/u_gctors.cpp
+++ b/src/gallium/auxiliary/util/u_gctors.cpp
@@ -4,7 +4,7 @@
    __attribute__((constructor)) allows to do this in C, but is GCC-only
 */
 
-extern "C" void util_half_init_tables(void);
+#include "u_half.h"
 
 struct util_gctor_t
 {
diff --git a/src/gallium/auxiliary/util/u_half.c b/src/gallium/auxiliary/util/u_half.c
index 8865acb..62d74d4 100644
--- a/src/gallium/auxiliary/util/u_half.c
+++ b/src/gallium/auxiliary/util/u_half.c
@@ -22,9 +22,6 @@ uint32_t util_half_to_float_offset_table[64];
 uint16_t util_float_to_half_base_table[512];
 uint8_t util_float_to_half_shift_table[512];
 
-/* called by u_gctors.cpp, which defines the prototype itself */
-void util_half_init_tables(void);
-
 void util_half_init_tables(void)
 {
 	int i;
diff --git a/src/gallium/auxiliary/util/u_half.h b/src/gallium/auxiliary/util/u_half.h
index 54e7c74..0ca660f 100644
--- a/src/gallium/auxiliary/util/u_half.h
+++ b/src/gallium/auxiliary/util/u_half.h
@@ -4,6 +4,12 @@
 #include "pipe/p_compiler.h"
 #include "u_math.h"
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern uint32_t util_half_to_float_mantissa_table[2048];
 extern uint32_t util_half_to_float_exponent_table[64];
 extern uint32_t util_half_to_float_offset_table[64];
@@ -53,4 +59,12 @@ util_float_to_half(float f)
 	return util_floatui_to_half(i.ui);
 }
 
+/* called by u_gctors.cpp, which defines the prototype itself */
+void util_half_init_tables(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* U_HALF_H */




More information about the mesa-commit mailing list