aboutsummaryrefslogtreecommitdiffstats
path: root/regint.h
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-27 19:02:45 +0900
committerGitHub <noreply@github.com>2021-09-27 19:02:45 +0900
commitefa0c31ce518bb26aca80392cce7fc5471ca9fef (patch)
treef3360895fafdbd641ee0bcff5b19013ca58dbc19 /regint.h
parentf8000e293141a9af9f51effc76007aab21b0dede (diff)
downloadruby-efa0c31ce518bb26aca80392cce7fc5471ca9fef.tar.gz
Add printf-style format attribute to oniguruma functions
Also make the format string compatible with literal strings which are const arrays of "plain" chars.
Diffstat (limited to 'regint.h')
-rw-r--r--regint.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/regint.h b/regint.h
index 0740429688..b136d804dc 100644
--- a/regint.h
+++ b/regint.h
@@ -903,9 +903,13 @@ extern void onig_print_statistics(FILE* f);
# endif
#endif
+#ifndef PRINTF_ARGS
+#define PRINTF_ARGS(func, fmt, vargs) func
+#endif
+
extern UChar* onig_error_code_to_format(OnigPosition code);
-extern void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, va_list args);
-extern void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...);
+PRINTF_ARGS(extern void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const char *fmt, va_list args), 6, 0);
+PRINTF_ARGS(extern void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const char *fmt, ...), 6, 7);
extern int onig_bbuf_init(BBuf* buf, OnigDistance size);
extern int onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo);
#ifdef RUBY