glsl/apps: Predefine __GLSL_PP_PREDEFINED_MACRO_TEST for testing.
authorMichal Krol <michal@vmware.com>
Thu, 10 Dec 2009 11:58:44 +0000 (12:58 +0100)
committerMichal Krol <michal@vmware.com>
Thu, 10 Dec 2009 11:58:44 +0000 (12:58 +0100)
src/glsl/apps/process.c

index 6c5c7bc420f4ac87f254c512ae8c605f04ff4ca9..b793cc086d813af8d28bb28c45c6e40c426161b5 100644 (file)
@@ -132,6 +132,16 @@ main(int argc,
       return 0;
    }
 
+   if (sl_pp_context_add_predefined(context, "__GLSL_PP_PREDEFINED_MACRO_TEST", "1")) {
+      fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context));
+
+      printf("Error: %s\n", sl_pp_context_error_message(context));
+      sl_pp_context_destroy(context);
+      free(tokens);
+      fclose(out);
+      return 0;
+   }
+
    if (sl_pp_process(context, &tokens[tokens_eaten], &outtokens)) {
       fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context));