_SC_ARG_MAX undeclared
titoshadow opened this issue · comments
When compiling in Windows / non POSIX environment (e.g. MSYS2), make fails with:
shc.c: In function 'read_script':
shc.c:1093:24: warning: implicit declaration of function 'sysconf'; did you mean 'swscanf'? [-Wimplicit-function-declaration]
1093 | if (l > 0.80 * (cnt = sysconf(_SC_ARG_MAX))) {
| ^~~~~~~
| swscanf
shc.c:1093:32: error: '_SC_ARG_MAX' undeclared (first use in this function); did you mean 'SCHAR_MAX'?
1093 | if (l > 0.80 * (cnt = sysconf(_SC_ARG_MAX))) {
| ^~~~~~~~~~~
| SCHAR_MAX
shc.c:1093:32: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [Makefile:344: shc.o] Error 1
make[1]: se sale del directorio '/home/fdsa/shc/src'
make: *** [Makefile:413: all-recursive] Error 1
Since (I think) its just a check, I commented out that if, thus can compile now (did not find an easy method to check that value on Windows, nor was able to change to cygwin or so)
I also have this problem, Still try to find solution. Seems sysconf is native to Linux GCC?