diff options
author | Ian Romanick <[email protected]> | 2010-08-12 15:05:39 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-08-12 15:05:39 -0700 |
commit | 261bbc011d11ab9e390cd5fe9f5151821eefaffa (patch) | |
tree | 2c87248158e67fa7e1714dbb583ef3a773aceeb9 | |
parent | 2d83e3fa0de6e0b39307cdc67725ca88855d68d2 (diff) |
glsl2: Use Elements from main/compiler.h instead of open-coding
-rw-r--r-- | src/glsl/builtin_function.cpp | 5 | ||||
-rw-r--r-- | src/glsl/builtin_types.h | 4 | ||||
-rwxr-xr-x | src/glsl/builtins/tools/generate_builtins.pl | 5 | ||||
-rw-r--r-- | src/glsl/glsl_types.cpp | 1 | ||||
-rw-r--r-- | src/glsl/ir_variable.cpp | 5 | ||||
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 1 |
6 files changed, 5 insertions, 16 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 12e6909a287..1d9a58a5caf 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -23,6 +23,7 @@ */ #include <stdio.h> +#include "main/compiler.h" #include "glsl_parser_extras.h" #include "ir_reader.h" #include "program.h" @@ -4799,10 +4800,6 @@ static const char *functions_for_EXT_texture_array_fs [] = { builtins_EXT_texture_array_fs_textures, }; -#ifndef Elements -#define Elements(x) (sizeof(x)/sizeof(*(x))) -#endif - void *builtin_mem_ctx = NULL; void diff --git a/src/glsl/builtin_types.h b/src/glsl/builtin_types.h index bfa4f3f5408..7b94aac666b 100644 --- a/src/glsl/builtin_types.h +++ b/src/glsl/builtin_types.h @@ -21,10 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#ifndef Elements -#define Elements(x) (sizeof(x)/sizeof(*(x))) -#endif - const glsl_type glsl_type::_error_type = glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, ""); diff --git a/src/glsl/builtins/tools/generate_builtins.pl b/src/glsl/builtins/tools/generate_builtins.pl index 61d511da1d4..91ef8917b0a 100755 --- a/src/glsl/builtins/tools/generate_builtins.pl +++ b/src/glsl/builtins/tools/generate_builtins.pl @@ -62,6 +62,7 @@ print << 'EOF'; */ #include <stdio.h> +#include "main/compiler.h" #include "glsl_parser_extras.h" #include "ir_reader.h" #include "program.h" @@ -110,10 +111,6 @@ foreach $version (@versions) { } print << 'EOF'; -#ifndef Elements -#define Elements(x) (sizeof(x)/sizeof(*(x))) -#endif - void *builtin_mem_ctx = NULL; void diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 2aba1e0ac1d..8e80cf99e96 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -23,6 +23,7 @@ #include <cstdio> #include <stdlib.h> +#include "main/compiler.h" #include "glsl_symbol_table.h" #include "glsl_parser_extras.h" #include "glsl_types.h" diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp index d88cb515b47..917c06743b4 100644 --- a/src/glsl/ir_variable.cpp +++ b/src/glsl/ir_variable.cpp @@ -21,15 +21,12 @@ * DEALINGS IN THE SOFTWARE. */ +#include "main/compiler.h" #include "ir.h" #include "glsl_parser_extras.h" #include "glsl_symbol_table.h" #include "builtin_variables.h" -#ifndef Elements -#define Elements(x) (sizeof(x)/sizeof(*(x))) -#endif - static void generate_ARB_draw_buffers_variables(exec_list *, struct _mesa_glsl_parse_state *, bool, _mesa_glsl_parser_targets); diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index a9a6f977c01..ecb13069cb7 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -31,6 +31,7 @@ */ #include <stdio.h> +#include "main/compiler.h" #include "ir.h" #include "ir_visitor.h" #include "ir_print_visitor.h" |