diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-09-27 19:02:45 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 19:02:45 +0900 |
commit | efa0c31ce518bb26aca80392cce7fc5471ca9fef (patch) | |
tree | f3360895fafdbd641ee0bcff5b19013ca58dbc19 /regint.h | |
parent | f8000e293141a9af9f51effc76007aab21b0dede (diff) |
Add printf-style format attribute to oniguruma functions
Also make the format string compatible with literal strings which
are const arrays of "plain" chars.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4899
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'regint.h')
-rw-r--r-- | regint.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |