summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorLourens Naudé <lourens@bearmetal.eu>2019-03-16 12:48:34 +0000
committerNARUSE, Yui <naruse@airemix.jp>2019-04-24 00:40:17 +0900
commit31cf13060cce44d782b068cf083b1ae4def6dc09 (patch)
treea6ef81ff6c7132781b5865f02bc1526505dc35f2 /include/ruby
parent14dd8d6b370797f2e419205e9f28368433dc6ceb (diff)
downloadruby-31cf13060cce44d782b068cf083b1ae4def6dc09.tar.gz
Only define history_root member of the Oniguruma re_registers struct if USE_CAPTURE_HISTORY is enabled
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/onigmo.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ruby/onigmo.h b/include/ruby/onigmo.h
index 385f2d6a8b..34b8268d59 100644
--- a/include/ruby/onigmo.h
+++ b/include/ruby/onigmo.h
@@ -701,6 +701,7 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
+#ifdef USE_CAPTURE_HISTORY
typedef struct OnigCaptureTreeNodeStruct {
int group; /* group number */
OnigPosition beg;
@@ -709,6 +710,7 @@ typedef struct OnigCaptureTreeNodeStruct {
int num_childs;
struct OnigCaptureTreeNodeStruct** childs;
} OnigCaptureTreeNode;
+#endif
/* match result region type */
struct re_registers {
@@ -716,8 +718,10 @@ struct re_registers {
int num_regs;
OnigPosition* beg;
OnigPosition* end;
+#ifdef USE_CAPTURE_HISTORY
/* extended */
OnigCaptureTreeNode* history_root; /* capture history tree root */
+#endif
};
/* capture tree traverse */
@@ -866,8 +870,10 @@ ONIG_EXTERN
int onig_number_of_captures(const OnigRegexType *reg);
ONIG_EXTERN
int onig_number_of_capture_histories(const OnigRegexType *reg);
+#ifdef USE_CAPTURE_HISTORY
ONIG_EXTERN
OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region);
+#endif
ONIG_EXTERN
int onig_capture_tree_traverse(OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg);
ONIG_EXTERN