Fix incompatibility with <GL/glext.h>

New extensions in glext.h follow the pattern:

    #ifndef GL_ARB_texture_rectangle
    #define GL_ARB_texture_rectangle 1
    #define GL_TEXTURE_RECTANGLE_ARB          0x84F5
    #define GL_TEXTURE_BINDING_RECTANGLE_ARB  0x84F6
    #define GL_PROXY_TEXTURE_RECTANGLE_ARB    0x84F7
    #define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
    #endif /* GL_ARB_texture_rectangle */

Versions.h tries to declare:

    const char* const GL_ARB_texture_rectangle = "GL_ARB_texture_rectangle";

Which means, if you've included glext.h before Versions.h, that the
compiler will see "const char* const 1 = ...", and rightly refuse to
continue.

The ham-fisted approach taken here is to rename the variables in
Versions.h with a leading underscore.  This does sort of undermine the
comment about "better to have the compiler do spelling checks", but.

Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2015-06-30 10:11:38 -04:00
parent 1189a7bc4a
commit 93deac5295
6 changed files with 221 additions and 221 deletions

View file

@ -809,7 +809,7 @@ parameter_declarator
// Type + name
: type_specifier IDENTIFIER {
if ($1.arraySizes) {
parseContext.profileRequires($1.loc, ENoProfile, 120, GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, ENoProfile, 120, _GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getSize());
}
@ -824,7 +824,7 @@ parameter_declarator
}
| type_specifier IDENTIFIER array_specifier {
if ($1.arraySizes) {
parseContext.profileRequires($1.loc, ENoProfile, 120, GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, ENoProfile, 120, _GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getSize());
}
@ -953,7 +953,7 @@ fully_specified_type
parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $$);
if ($1.arraySizes) {
parseContext.profileRequires($1.loc, ENoProfile, 120, GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, ENoProfile, 120, _GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
}
@ -964,7 +964,7 @@ fully_specified_type
parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2);
if ($2.arraySizes) {
parseContext.profileRequires($2.loc, ENoProfile, 120, GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($2.loc, ENoProfile, 120, _GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
}
@ -1956,7 +1956,7 @@ struct_declaration_list
struct_declaration
: type_specifier struct_declarator_list SEMICOLON {
if ($1.arraySizes) {
parseContext.profileRequires($1.loc, ENoProfile, 120, GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, ENoProfile, 120, _GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
if (parseContext.profile == EEsProfile)
parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getSize());
@ -1975,7 +1975,7 @@ struct_declaration
| type_qualifier type_specifier struct_declarator_list SEMICOLON {
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
if ($2.arraySizes) {
parseContext.profileRequires($2.loc, ENoProfile, 120, GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($2.loc, ENoProfile, 120, _GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
if (parseContext.profile == EEsProfile)
parseContext.arraySizeRequiredCheck($2.loc, $2.arraySizes->getSize());
@ -2028,13 +2028,13 @@ initializer
| LEFT_BRACE initializer_list RIGHT_BRACE {
const char* initFeature = "{ } style initializers";
parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
parseContext.profileRequires($1.loc, ~EEsProfile, 420, GL_ARB_shading_language_420pack, initFeature);
parseContext.profileRequires($1.loc, ~EEsProfile, 420, _GL_ARB_shading_language_420pack, initFeature);
$$ = $2;
}
| LEFT_BRACE initializer_list COMMA RIGHT_BRACE {
const char* initFeature = "{ } style initializers";
parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
parseContext.profileRequires($1.loc, ~EEsProfile, 420, GL_ARB_shading_language_420pack, initFeature);
parseContext.profileRequires($1.loc, ~EEsProfile, 420, _GL_ARB_shading_language_420pack, initFeature);
$$ = $2;
}
;