From cbfa5398a921817064dc2dd3862d654c408bde7f Mon Sep 17 00:00:00 2001 From: jakcron Date: Tue, 6 Jun 2017 12:58:49 +0800 Subject: [PATCH] [ctrtool] Fix compiling on Visual Studio. --- ctrtool/syscalls.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ctrtool/syscalls.c b/ctrtool/syscalls.c index cd37cf8..f450535 100644 --- a/ctrtool/syscalls.c +++ b/ctrtool/syscalls.c @@ -139,8 +139,13 @@ static const char *const syscall_list[NUM_SYSCALLS] = void syscall_get_name(char *output, size_t size, unsigned int call_num) { +#ifdef _MSC_VER + typedef char StaticAssert[sizeof(syscall_list) / sizeof(syscall_list[0]) == NUM_SYSCALLS ? 1 : -1]; +#else _Static_assert(sizeof(syscall_list) / sizeof(syscall_list[0]) == NUM_SYSCALLS, "syscall table length mismatch"); +#endif + if (size == 0) {