From cf92ba7a67418a656946a752322934ceb6de0a9e Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Fri, 22 Jul 2016 19:21:36 +0900 Subject: [PATCH] edc_parse: Check more cases to update EDC info correctly. "#if", "#endif", and "#define" cases are checked to update EDC information correctly. This fixes commit 2fc82c79d333fb7d8a287e52cc9a804bb1247d8f --- src/lib/edc_parser.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/lib/edc_parser.c b/src/lib/edc_parser.c index 698f1e1..671c34c 100644 --- a/src/lib/edc_parser.c +++ b/src/lib/edc_parser.c @@ -153,6 +153,35 @@ cur_context_thread_blocking(void *data, Ecore_Thread *thread EINA_UNUSED) continue; } } + //Skip #if ~ #endif + if (!strncmp(p, "#if", 3)) + { + p = strstr(p, "#endif"); + if (!p) goto end; + p += 6; //strlen(#endif) + continue; + } + + //Skip #define + if (!strncmp(p, "#define", 7)) + { + //escape "\", "ie, #define .... \" + p += 7; //strlen(#define) + + while (p <= end) + { + char *eol = strstr(p, "\n"); + if (!eol) goto end; + + char *slash = strstr(p, "\\"); + + p = eol + 1; + + if (!slash || (eol < slash)) + break; + } + continue; + } //Check whether outside of description or part or group if ((*p == '}') && (p < end)) {