[ruby/fiddle] Use "do { } while (0)" to ensure requiring ";"

https://github.com/ruby/fiddle/commit/2155ae5979
This commit is contained in:
Sutou Kouhei 2020-06-27 07:10:37 +09:00 коммит произвёл Nobuyoshi Nakada
Родитель 0faf6c8c0e
Коммит 50fbd00e76
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7CD2805BFA3770C6
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -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)