mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/fiddle] Use "do { } while (0)" to ensure requiring ";"
2155ae5979
This commit is contained in:
parent
0faf6c8c0e
commit
50fbd00e76
Notes:
git
2020-06-28 02:03:20 +09:00
1 changed files with 8 additions and 8 deletions
|
@ -19,14 +19,14 @@ VALUE cFiddleFunction;
|
|||
#define Check_Max_Args_Long(name, len) \
|
||||
Check_Max_Args_(name, len, "l")
|
||||
#define Check_Max_Args_(name, len, fmt) \
|
||||
if ((size_t)(len) < MAX_ARGS) { \
|
||||
/* OK */ \
|
||||
} \
|
||||
else { \
|
||||
rb_raise(rb_eTypeError, \
|
||||
name" is so large that it can cause integer overflow (%"fmt"d)", \
|
||||
(len)); \
|
||||
}
|
||||
do { \
|
||||
if ((size_t)(len) >= MAX_ARGS) { \
|
||||
rb_raise(rb_eTypeError, \
|
||||
"%s is so large " \
|
||||
"that it can cause integer overflow (%"fmt"d)", \
|
||||
(name), (len)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static void
|
||||
deallocate(void *p)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue