summaryrefslogtreecommitdiff
path: root/src/glsl/pp/sl_pp_process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/pp/sl_pp_process.c')
-rw-r--r--src/glsl/pp/sl_pp_process.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c
index 4715eed2fc..c17a3ac7ce 100644
--- a/src/glsl/pp/sl_pp_process.c
+++ b/src/glsl/pp/sl_pp_process.c
@@ -122,13 +122,7 @@ sl_pp_process(struct sl_pp_context *context,
last = i - 1;
- if (!strcmp(name, "define")) {
- if (context->if_value) {
- if (sl_pp_process_define(context, input, first, last)) {
- return -1;
- }
- }
- } else if (!strcmp(name, "if")) {
+ if (!strcmp(name, "if")) {
if (sl_pp_process_if(context, input, first, last)) {
return -1;
}
@@ -152,8 +146,18 @@ sl_pp_process(struct sl_pp_context *context,
if (sl_pp_process_endif(context, input, first, last)) {
return -1;
}
- } else {
- /* XXX: Ignore. */
+ } else if (context->if_value) {
+ if (!strcmp(name, "define")) {
+ if (sl_pp_process_define(context, input, first, last)) {
+ return -1;
+ }
+ } else if (!strcmp(name, "undef")) {
+ if (sl_pp_process_undef(context, input, first, last)) {
+ return -1;
+ }
+ } else {
+ /* XXX: Ignore. */
+ }
}
}
break;