Mesa (master): gallium/util: use #pragma section instead of #pragma data_seg
Luca Barbieri
lb at kemper.freedesktop.org
Fri Apr 2 00:10:59 UTC 2010
Module: Mesa
Branch: master
Commit: 3040462c10c19ba8f4a2ab64feee41a18c86a578
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3040462c10c19ba8f4a2ab64feee41a18c86a578
Author: Luca Barbieri <luca at luca-barbieri.com>
Date: Fri Apr 2 00:41:51 2010 +0200
gallium/util: use #pragma section instead of #pragma data_seg
They apparently both declare the section, but #pragma data_seg
also puts all subsequent definitions in the section, which is
undesirable.
This should be the correct solution, and is actually used by the
reference I cited (but I forgot to do it in my code).
Untested, let me know if it doesn't work.
---
src/gallium/auxiliary/util/u_init.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_init.h b/src/gallium/auxiliary/util/u_init.h
index 40dafad..7bc356a 100644
--- a/src/gallium/auxiliary/util/u_init.h
+++ b/src/gallium/auxiliary/util/u_init.h
@@ -40,7 +40,7 @@
/* add a pointer to the section where MSVC stores global constructor pointers */
/* see http://blogs.msdn.com/vcblog/archive/2006/10/20/crt-initialization.aspx and
http://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc */
-#pragma data_seg(".CRT$XCU")
+#pragma section(".CRT$XCU",read)
#define UTIL_INIT(f) static void __cdecl f##__init(void) {f();}; __declspec(allocate(".CRT$XCU")) void (__cdecl* f##__xcu)(void) = f##__init;
#elif defined(__GNUC__)
#define UTIL_INIT(f) static void f##__init(void) __attribute__((constructor)); static void f##__init(void) {f();}
More information about the mesa-commit
mailing list