]> granicus.if.org Git - onig/commitdiff
Add a macro to disable direct threading in the match engine
authorRyan Lopopolo <rjl@hyperbo.la>
Tue, 13 Aug 2019 02:37:56 +0000 (19:37 -0700)
committerRyan Lopopolo <rjl@hyperbo.la>
Tue, 13 Aug 2019 02:37:56 +0000 (19:37 -0700)
When defined, ONIG_DISABLE_DIRECT_THREADING disallows using computed
gotos in the match engine. Defining this macro enables onig to build
with the wasm32-unknown-unknown target on clang-8.

clang trunk enables support for computed gotos:
<https://bugs.llvm.org/show_bug.cgi?id=42498>

This commit enables building on released clang.

src/regint.h

index 5f5e6da3947f50535840b958130dee838650c7ec..1e6dc0cfb797f439516c3837720f752b0b64e45a 100644 (file)
 #define PLATFORM_UNALIGNED_WORD_ACCESS
 #endif
 
+#ifndef ONIG_DISABLE_DIRECT_THREADING
 #ifdef __GNUC__
 #define USE_GOTO_LABELS_AS_VALUES
 #endif
+#endif
 
 /* config */
 /* spec. config */