mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 12:18:09 +02:00
glapi: work-around MSVC 65K string length limitation for enums.c
String literals cannot exceed 65535 characters for MSVC. Instead of emiting a string, emit an array of characters. v2: fix indentation and add comment in the gl_enums.py file about this ugliness. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
148c2f5b17
commit
f391b95105
1 changed files with 10 additions and 3 deletions
|
|
@ -156,14 +156,21 @@ _mesa_lookup_prim_by_nr(GLuint nr)
|
|||
print '# define LONGSTRING'
|
||||
print '#endif'
|
||||
print ''
|
||||
print 'LONGSTRING static const char enum_string_table[] = '
|
||||
print 'LONGSTRING static const char enum_string_table[] = {'
|
||||
# We express the very long concatenation of enum strings as an array
|
||||
# of characters rather than as a string literal to work-around MSVC's
|
||||
# 65535 character limit.
|
||||
for enum in sorted_enum_values:
|
||||
(name, pri) = self.enum_table[enum]
|
||||
print ' "%s\\0"' % (name)
|
||||
print " ",
|
||||
for ch in name:
|
||||
print "'%c'," % ch,
|
||||
print "'\\0',"
|
||||
|
||||
string_offsets[ enum ] = i
|
||||
i += len(name) + 1
|
||||
|
||||
print ' ;'
|
||||
print '};'
|
||||
print ''
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue