comparison auto/types/sizeof @ 0:f0b350454894 NGINX_0_1_0

nginx 0.1.0 *) The first public version.
author Igor Sysoev <http://sysoev.ru>
date Mon, 04 Oct 2004 00:00:00 +0400
parents
children 4b2dafa26fe2
comparison
equal deleted inserted replaced
-1:000000000000 0:f0b350454894
1
2 # Copyright (C) Igor Sysoev
3
4
5 echo $ngx_n "checking for $ngx_type size ..." $ngx_c
6 echo >> $NGX_ERR
7 echo "checking for $ngx_type size" >> $NGX_ERR
8
9 ngx_size=
10
11 cat << END > $NGX_AUTOTEST.c
12
13 #include <sys/types.h>
14 #include <sys/time.h>
15 $NGX_UNISTD_H
16 #include <signal.h>
17 #include <sys/resource.h>
18 $NGX_INTTYPES_H
19 $NGX_AUTO_CONFIG
20
21 int main() {
22 printf("%d", sizeof($ngx_type));
23 return 0;
24 }
25
26 END
27
28 eval "$CC $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
29
30 if [ -x $NGX_AUTOTEST ]; then
31 ngx_size=`$NGX_AUTOTEST`
32 echo " $ngx_size bytes"
33 fi
34
35 rm $NGX_AUTOTEST*
36
37 case $ngx_size in
38 4)
39 if [ "$ngx_type"="long" ]; then
40 ngx_max_value=2147483647L
41 else
42 ngx_max_value=2147483647
43 fi
44
45 ngx_max_len='sizeof("-2147483648") - 1'
46 ;;
47
48 8)
49 if [ "$ngx_type"="long long" ]; then
50 ngx_max_value=9223372036854775807LL
51 else
52 ngx_max_value=9223372036854775807L
53 fi
54
55 ngx_max_len='sizeof("-9223372036854775808") - 1'
56 ;;
57
58 *)
59 echo
60 echo "$0: error: can not detect $ngx_type size"
61 exit 1
62 esac