[Mesa-dev] [PATCH 1/2] mesa: move LONGSTRING into generated enums.c

Brian Paul brianp at vmware.com
Wed Mar 11 18:29:57 PDT 2015


enums.c is the only place this directive is needed.
---
 src/mapi/glapi/gen/gl_enums.py | 6 ++++++
 src/mesa/main/compiler.h       | 9 ---------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py
index d61618f..f45782d 100644
--- a/src/mapi/glapi/gen/gl_enums.py
+++ b/src/mapi/glapi/gen/gl_enums.py
@@ -157,6 +157,12 @@ _mesa_lookup_prim_by_nr(GLuint nr)
 
         string_offsets = {}
         i = 0;
+        print '#if defined(__GNUC__)'
+        print '# define LONGSTRING __extension__'
+        print '#else'
+        print '# define LONGSTRING'
+        print '#endif'
+        print ''
         print 'LONGSTRING static const char enum_string_table[] = '
         for enum, name in enum_table:
             print '   "%s\\0"' % (name)
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index b9f808e..5c60391 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -113,15 +113,6 @@ extern "C" {
 #define LE32_TO_CPU( x )	CPU_TO_LE32( x )
 
 
-/**
- * LONGSTRING macro
- * gcc -pedantic warns about long string literals, LONGSTRING silences that.
- */
-#if !defined(__GNUC__)
-# define LONGSTRING
-#else
-# define LONGSTRING __extension__
-#endif
 
 #define IEEE_ONE 0x3f800000
 
-- 
1.9.1



More information about the mesa-dev mailing list