comparison auto/types/sizeof @ 210:00cafae0bdf1

nginx-0.0.1-2003-12-14-23:10:27 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 14 Dec 2003 20:10:27 +0000
parents 11fbd0fc041d
children 5d4f49dc8de5
comparison
equal deleted inserted replaced
209:e1c815be05ae 210:00cafae0bdf1
1 1
2 echo "checking for $NGX_TYPE size" 2 echo -n "checking for $ngx_type size ..."
3 echo >> $NGX_ERR
4 echo "checking for $ngx_type size" >> $NGX_ERR
3 5
4 NGX_BYTES= 6 ngx_bytes=
5 7
6 echo "#include <sys/types.h>" > autotest.c 8 cat << END > $NGX_AUTOTEST.c
7 echo "#include <sys/time.h>" >> autotest.c
8 echo "#include <sys/resource.h>" >> autotest.c
9 echo "$NGX_INTTYPES_H" >> autotest.c
10 echo "$NGX_AUTO_CONFIG" >> autotest.c
11 echo "int main() {" >> autotest.c
12 echo "printf(\"%d\", sizeof($NGX_TYPE));" >> autotest.c
13 echo "return 0; }" >> autotest.c
14 9
15 eval "$CC $CC_TEST_FLAGS -o autotest autotest.c > /dev/null 2>&1" 10 #include <sys/time.h>
11 #include <sys/resource.h>
12 $NGX_INTTYPES_H
13 $NGX_AUTO_CONFIG
16 14
17 if [ -x ./autotest ]; then 15 int main() {
18 NGX_BYTES=`./autotest` 16 printf("%d", sizeof($ngx_type));
19 echo " + $NGX_TYPE is $NGX_BYTES bytes" 17 return 0;
18 }
19
20 END
21
22 eval "$CC $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
23
24 if [ -x $NGX_AUTOTEST ]; then
25 ngx_bytes=`$NGX_AUTOTEST`
26 echo " $ngx_bytes bytes"
20 fi 27 fi
21 28
22 rm autotest* 29 rm $NGX_AUTOTEST*
23 30
24 case $NGX_BYTES in 31 case $ngx_bytes in
25 4) 32 4)
26 if [ "$NGX_TYPE"="long" ]; then 33 if [ "$ngx_type"="long" ]; then
27 NGX_MAX_SIZE=2147483647L 34 ngx_max_size=2147483647L
28 else 35 else
29 NGX_MAX_SIZE=2147483647 36 ngx_max_size=2147483647
30 fi 37 fi
31 ;; 38 ;;
32 39
33 8) 40 8)
34 if [ "$NGX_TYPE"="long long" ]; then 41 if [ "$ngx_type"="long long" ]; then
35 NGX_MAX_SIZE=9223372036854775807LL 42 ngx_max_size=9223372036854775807LL
36 else 43 else
37 NGX_MAX_SIZE=9223372036854775807L 44 ngx_max_size=9223372036854775807L
38 fi 45 fi
39 ;; 46 ;;
40 47
41 *) 48 *)
42 echo "$0: error: can not detect $NGX_TYPE size" 49 echo
50 echo "$0: error: can not detect $ngx_type size"
43 exit 1 51 exit 1
44 esac 52 esac