From 1c138327e0537bb55f7d0810f6fe7e1c7f63b6c5 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Fri, 28 Aug 2020 22:03:06 +0900 Subject: Try to fix compile error on windows https://github.com/ruby/ruby/runs/1041040167?check_suite_focus=true#step:11:177 ``` compiling ../src/re.c re.c ../src/re.c(317): error C2057: expected constant expression ../src/re.c(317): error C2466: cannot allocate an array of constant size 0 ../src/re.c(467): error C2057: expected constant expression ../src/re.c(467): error C2466: cannot allocate an array of constant size 0 ../src/re.c(467): error C2133: 'opts': unknown size ../src/re.c(559): error C2057: expected constant expression ../src/re.c(559): error C2466: cannot allocate an array of constant size 0 ../src/re.c(559): error C2133: 'optbuf': unknown size ../src/re.c(673): error C2057: expected constant expression ../src/re.c(673): error C2466: cannot allocate an array of constant size 0 ../src/re.c(673): error C2133: 'opts': unknown size NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.EXE"' : return code '0x2' Stop. ``` --- re.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.c b/re.c index d0dbfaaa29..badd321782 100644 --- a/re.c +++ b/re.c @@ -311,7 +311,7 @@ char_to_option(int c) return val; } -static const int OPTBUF_SIZE = 4; +enum { OPTBUF_SIZE = 4 }; static char * option_to_str(char str[OPTBUF_SIZE], int options) -- cgit v1.2.3