Skip to content

Commit

Permalink
libast/comp/conf.sh: apply limits detection fixes for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Feb 2, 2021
1 parent fa3a3d7 commit 7a6980a
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions src/lib/libast/comp/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ main()
return 1;
#else
_ast_intmax_t s = 0x7fffffffffffffffLL;
unsigned _ast_intmax_t u = 0xffffffffffffffffLL;
unsigned _ast_intmax_t u = 0xffffffffffffffffULL;
return 0;
#endif
Expand Down Expand Up @@ -817,7 +817,11 @@ defined() # list-file
cat <<!
${head}
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#if defined(__linux__)
#include <linux/limits.h>
#endif
#include <unistd.h>$systeminfo$headers
${tail}
#undef conf
Expand Down Expand Up @@ -845,7 +849,11 @@ unsigned int conf[] = {
cat <<!
${head}
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#if defined(__linux__)
#include <linux/limits.h>
#endif
#include <unistd.h>$systeminfo$headers
${tail}
#undef conf
Expand Down Expand Up @@ -886,7 +894,11 @@ done
cat <<!
${head}
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#if defined(__linux__)
#include <linux/limits.h>
#endif
#include <unistd.h>$systeminfo$headers
${tail}
#undef conf
Expand Down Expand Up @@ -1064,7 +1076,7 @@ do eval name=\"'$'CONF_name_$key\"
case $flags in
*[Ll]*) d=
case ${conf_name} in
LONG_MAX|SSIZE_MAX)
LONG_MAX|UINT_MAX|INT_MAX|SHRT_MAX|SSIZE_MAX|WORD_BIT|LONG_BIT|PTHREAD_*)
x=
;;
*) eval x='$'CONF_const_${conf_name}
Expand Down Expand Up @@ -1124,7 +1136,11 @@ do eval name=\"'$'CONF_name_$key\"
${head}
#include <stdio.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#if defined(__linux__)
#include <linux/limits.h>
#endif
#include <unistd.h>$systeminfo$headers
${tail}
int
Expand All @@ -1139,7 +1155,11 @@ main()
${head}
#include <stdio.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#if defined(__linux__)
#include <linux/limits.h>
#endif
#include <unistd.h>$systeminfo$headers
${tail}
${script}
Expand Down Expand Up @@ -1286,7 +1306,11 @@ printf("#endif\n");
*) cat > $tmp.c <<!
${head}
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#if defined(__linux__)
#include <linux/limits.h>
#endif
#include <unistd.h>$systeminfo$headers
${tail}
${script}
Expand Down Expand Up @@ -1365,7 +1389,7 @@ ${script}
*[lLuU])
case $LL_suffix in
??) case $conf_limit in
*[!lL][lL]|*[!lL][lL][uU])
*[0-9a-fA-F][lL]|*[0-9a-fA-F][uU][lL])
conf_limit=${conf_limit}L
;;
esac
Expand Down Expand Up @@ -1400,7 +1424,7 @@ ${script}
*[lLuU])
case $LL_suffix in
??) case $conf_minmax in
*[!lL][lL]|*[!lL][lL][uU])
*[0-9a-fA-F][lL]|*[0-9a-fA-F][uU][lL])
conf_minmax=${conf_minmax}L
;;
esac
Expand Down Expand Up @@ -1577,7 +1601,11 @@ esac
cat <<!
${head}
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#if defined(__linux__)
#include <linux/limits.h>
#endif
#include <unistd.h>$systeminfo$headers
${tail}
#include "${base}.h"
Expand Down

0 comments on commit 7a6980a

Please sign in to comment.