comparison auto/types/sizeof @ 6015:e11a8e7e8e0c

Configure: fixed type max value detection. The code tried to use suffixes for "long" and "long long" types, but it never worked as intended due to the bug in the shell code. Also, the max value for any 64-bit type other than "long long" on platforms with 32-bit "long" would be incorrect if the bug was fixed. So instead of fixing the bug in the shell code, always use the "int" constant for 32-bit types, and "long long" constant for 64-bit types.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 18 Mar 2015 02:04:39 +0300
parents 434548349838
children 82a76258a142
comparison
equal deleted inserted replaced
6014:e370c5fdf4c8 6015:e11a8e7e8e0c
48 rm -rf $NGX_AUTOTEST* 48 rm -rf $NGX_AUTOTEST*
49 49
50 50
51 case $ngx_size in 51 case $ngx_size in
52 4) 52 4)
53 if [ "$ngx_type"="long" ]; then 53 ngx_max_value=2147483647
54 ngx_max_value=2147483647L
55 else
56 ngx_max_value=2147483647
57 fi
58
59 ngx_max_len='(sizeof("-2147483648") - 1)' 54 ngx_max_len='(sizeof("-2147483648") - 1)'
60 ;; 55 ;;
61 56
62 8) 57 8)
63 if [ "$ngx_type"="long long" ]; then 58 ngx_max_value=9223372036854775807LL
64 ngx_max_value=9223372036854775807LL
65 else
66 ngx_max_value=9223372036854775807L
67 fi
68
69 ngx_max_len='(sizeof("-9223372036854775808") - 1)' 59 ngx_max_len='(sizeof("-9223372036854775808") - 1)'
70 ;; 60 ;;
71 61
72 *) 62 *)
73 echo 63 echo