glsl2: Use Elements from main/compiler.h instead of open-coding
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 12 Aug 2010 22:05:39 +0000 (15:05 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 12 Aug 2010 22:05:39 +0000 (15:05 -0700)
src/glsl/builtin_function.cpp
src/glsl/builtin_types.h
src/glsl/builtins/tools/generate_builtins.pl
src/glsl/glsl_types.cpp
src/glsl/ir_variable.cpp
src/mesa/program/ir_to_mesa.cpp

index 12e6909a28759b7045707f0d99d65fa542d93297..1d9a58a5caf0d64d36b5d283af2926790625c7a7 100644 (file)
@@ -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
index bfa4f3f5408f75690deee85070cc21bb3127e9fd..7b94aac666b136e4e2cc8f3b52bd1754f7d21577 100644 (file)
  * 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, "");
 
index 61d511da1d49fa164ea7bacb35117f1e4b05f005..91ef8917b0ae6da55661030c83e88fa72c8dfca2 100755 (executable)
@@ -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
index 2aba1e0ac1d4392862b7a647bf9f5e5ae388327b..8e80cf99e96443d12f3688573f3fb70ad051c5b4 100644 (file)
@@ -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"
index d88cb515b470f8efba94160a7de262d233ea5fc2..917c06743b45b8046b0396db0d17c7abaf6cb654 100644 (file)
  * 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);
index a9a6f977c013734156f3992c6906963a7631889d..ecb13069cb7a3c342c737abfe3d99dcb6082d1b3 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include <stdio.h>
+#include "main/compiler.h"
 #include "ir.h"
 #include "ir_visitor.h"
 #include "ir_print_visitor.h"