From e5e64a119749f6f294c48548f37a33c3d807a2fa Mon Sep 17 00:00:00 2001 From: Shugo Maeda Date: Tue, 3 Jun 2025 13:09:25 +0900 Subject: [PATCH] Use -std=gnu17 to avoid the following error ``` gcc -c -O4 -Wall -pedantic -I.. -DPDC_WIDE ../pdcurses/addch.c In file included from ../curspriv.h:10, from ../pdcurses/addch.c:3: ../curses.h:86:23: error: 'bool' cannot be defined via 'typedef' 86 | typedef unsigned char bool; | ^~~~ ../curses.h:86:23: note: 'bool' is a keyword with '-std=c23' onwards ../curses.h:86:1: warning: useless type name in empty declaration 86 | typedef unsigned char bool; | ^~~~~~~ ``` --- ext/curses/extconf.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 5d94f781..2e1a6ebc 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -67,11 +67,8 @@ def exec_command(cmd) FileUtils.cp("pdcurses.lib", pdcurses_dir) $pdcurses_dll_default = true else - if $x64 - exec_command "make -f Makefile.mng clean all _w64=1 WIDE=Y DLL=N" - else - exec_command "make -f Makefile.mng clean all WIDE=Y DLL=N" - end + w64 = $x64 ? "_w64=1" : "" + exec_command "make -f Makefile.mng clean all #{w64} WIDE=Y DLL=N CC=\"gcc -std=gnu17\"" FileUtils.cp("pdcurses.a", File.expand_path("libpdcurses.a", pdcurses_dir)) end ensure