From: Carl Worth Date: Mon, 24 May 2010 18:27:23 +0000 (-0700) Subject: Switch to intmax_t (rather than int) for #if expressions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35419095f8d92f7dc5de472da3a0271d343cbcba;p=mesa.git Switch to intmax_t (rather than int) for #if expressions This is what the C99 specification demands. And the GLSL specification says that we should follow the "standard C++" rules for #if condition expressions rather than the GLSL rules, (which only support a 32-bit integer). --- diff --git a/glcpp-parse.y b/glcpp-parse.y index 0d3afa7af64..2c0fe9a6af9 100644 --- a/glcpp-parse.y +++ b/glcpp-parse.y @@ -107,6 +107,7 @@ glcpp_parser_lex (glcpp_parser_t *parser); %} %union { + intmax_t imaxval; int ival; char *str; argument_list_t *argument_list; @@ -119,7 +120,8 @@ glcpp_parser_lex (glcpp_parser_t *parser); %lex-param {glcpp_parser_t *parser} %token DEFINE DEFINED ELIF ELSE ENDIF FUNC_MACRO IDENTIFIER IDENTIFIER_FINALIZED IF IFDEF IFNDEF INTEGER OBJ_MACRO NEWLINE SPACE TOKEN UNDEF -%type expression INTEGER punctuator +%type punctuator +%type expression INTEGER %type content FUNC_MACRO IDENTIFIER IDENTIFIER_FINALIZED OBJ_MACRO %type argument_list %type macro parameter_list diff --git a/glcpp.h b/glcpp.h index 33ece8f92b1..503731b85b3 100644 --- a/glcpp.h +++ b/glcpp.h @@ -24,6 +24,8 @@ #ifndef GLCPP_H #define GLCPP_H +#include + #include #include "hash_table.h"