Changeset: 91eb86e931cc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=91eb86e931cc
Modified Files:
monetdb5/modules/mal/pcre.c
Branch: default
Log Message:
Avboid #ifdef inside a call to a macro.
The Visual Studio compiler can't deal with this.
diffs (53 lines):
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -388,20 +388,15 @@ pcre_likeselect(BAT **bnp, BAT *b, BAT *
q = SORTfndfirst(s, &o);
p = SORTfndfirst(s, &b->hseqbase);
candlist = (const oid *) Tloc(s, p);
+#ifdef HAVE_LIBPCRE
+#define BODY (pcre_exec(re, pe, v, (int) strlen(v), 0, 0, ovector, 10) >=
0)
+#else
+#define BODY (regexec(&re, v, (size_t) 0, NULL, 0) != REG_NOMATCH)
+#endif
if (anti)
- candscanloop(v && *v != '\200' &&
-#ifdef HAVE_LIBPCRE
- pcre_exec(re, pe, v, (int) strlen(v), 0, 0,
ovector, 10) == -1);
-#else
- regexec(&re, v, (size_t) 0, NULL, 0) ==
REG_NOMATCH);
-#endif
+ candscanloop(v && *v != '\200' && !BODY);
else
- candscanloop(v && *v != '\200' &&
-#ifdef HAVE_LIBPCRE
- pcre_exec(re, pe, v, (int) strlen(v), 0, 0,
ovector, 10) >= 0);
-#else
- regexec(&re, v, (size_t) 0, NULL, 0) !=
REG_NOMATCH);
-#endif
+ candscanloop(v && *v != '\200' && BODY);
} else {
if (s) {
assert(BATtdense(s));
@@ -416,19 +411,9 @@ pcre_likeselect(BAT **bnp, BAT *b, BAT *
q = BUNlast(b) + off;
}
if (anti)
- scanloop(v && *v != '\200' &&
-#ifdef HAVE_LIBPCRE
- pcre_exec(re, pe, v, (int) strlen(v), 0, 0,
ovector, 10) == -1);
-#else
- regexec(&re, v, (size_t) 0, NULL, 0) ==
REG_NOMATCH);
-#endif
+ scanloop(v && *v != '\200' && !BODY);
else
- scanloop(v && *v != '\200' &&
-#ifdef HAVE_LIBPCRE
- pcre_exec(re, pe, v, (int) strlen(v), 0, 0,
ovector, 10) >= 0);
-#else
- regexec(&re, v, (size_t) 0, NULL, 0) !=
REG_NOMATCH);
-#endif
+ scanloop(v && *v != '\200' && BODY);
}
#ifdef HAVE_LIBPCRE
my_pcre_free(re);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list