glsl/glcpp: Handle hex constants with 0X prefix
[mesa.git] / src / compiler / glsl / glcpp / glcpp-parse.y
index ccb3aa18d36ca086c8f7442bba6458382defec13..d83f99f1c7e05a567432bd96a879dcf993d6cf20 100644 (file)
@@ -462,13 +462,8 @@ control_line_error:
 
 integer_constant:
        INTEGER_STRING {
-               if (strlen ($1) >= 3 && strncmp ($1, "0x", 2) == 0) {
-                       $$ = strtoll ($1 + 2, NULL, 16);
-               } else if ($1[0] == '0') {
-                       $$ = strtoll ($1, NULL, 8);
-               } else {
-                       $$ = strtoll ($1, NULL, 10);
-               }
+               /* let strtoll detect the base */
+               $$ = strtoll ($1, NULL, 0);
        }
 |      INTEGER {
                $$ = $1;