abakh / nbsdgames

A package of 18 text-based modern games
Other
208 stars 16 forks source link

Does not build on macos (10.12) #1

Closed magnusviri closed 5 years ago

magnusviri commented 5 years ago

make cc sudoku.c -lncurses -lm -o ./sudoku sudoku.c:22:6: error: redefinition of 'wait' as different kind of symbol byte wait=0, waitcycles=0; ^ /usr/include/sys/wait.h:248:7: note: previous definition is here pid_t wait(int ) __DARWIN_ALIAS_C(wait); ^ sudoku.c:139:17: error: invalid operands to binary expression ('pid_t ()(int )' (aka 'int ()(int *)') and 'int') wait=(wait+1)%60;


sudoku.c:140:8: warning: address of function 'wait' will always evaluate to 'true' [-Wpointer-bool-conversion]
                        if(!wait && waitcycles<3)
                           ~^~~~
sudoku.c:140:8: note: prefix with the address-of operator to silence this warning
                        if(!wait && waitcycles<3)
                            ^
                            &
sudoku.c:150:18: warning: ordered comparison between pointer and integer ('int' and 'pid_t (*)(int *)' (aka 'int (*)(int *)'))
                        for(byte b=0;b<wait;b+=10)
                                     ~^~~~~
2 warnings and 2 errors generated.
make: *** [sudoku] Error 1
abakh commented 5 years ago

the 'wait' variable apparently conflicts with a macOS native library variable also named 'wait'. Easy to fix. Wait a bit...

abakh commented 5 years ago

Updated.@magnusviri Is it fixed?

magnusviri commented 5 years ago

Works, thank you. 1 warning.

cc jewels.c -lncurses -o ./jewels cc sudoku.c -lncurses -lm -o ./sudoku cc mines.c -lncurses -o ./mines cc reversi.c -lncurses -o ./reversi cc checkers.c -lncurses -o ./checkers cc battleship.c -lncurses -o ./battleship battleship.c:76:35: warning: expression result unused [-Wunused-value] mvaddch(sy,sx+10*2,ACS_URCORNER);- ^ 1 warning generated. cc rabbithole.c -lncurses -o ./rabbithole cc sos.c -lncurses -o ./sos cc pipes.c -lncurses -o ./pipes

abakh commented 5 years ago

there was a random '-' at the end of line 75. Fixed.