comparison auto/types/uintptr_t @ 195:8dee38ea9117

nginx-0.0.1-2003-11-25-23:44:56 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 25 Nov 2003 20:44:56 +0000
parents dd66383796a5
children 11fbd0fc041d
comparison
equal deleted inserted replaced
194:2357fa41738a 195:8dee38ea9117
1 1
2 found=0 2 echo 'checking for uintptr_t'
3 3
4 echo 'Checking for uintptr_t' 4 FOUND=NO
5 5
6 echo '#include <sys/types.h>' > autotest.c 6 echo "#include <sys/types.h>" > autotest.c
7 echo 'int main() { uintptr_t i = 0; return i; }' >> autotest.c 7 echo "int main() { uintptr_t i = 0; return 0; }" >> autotest.c
8 8
9 eval "${CC} -o autotest autotest.c > /dev/null 2>&1" 9 eval "$CC -o autotest autotest.c > /dev/null 2>&1"
10 10
11 if [ -x autotest ]; then 11 if [ -x autotest ]; then
12 echo ' + uintptr_t found' 12 echo " + uintptr_t found"
13 found=1 13 FOUND=YES
14 else 14 else
15 echo ' + uintptr_t not found' 15 echo " + uintptr_t not found"
16 fi 16 fi
17 17
18 rm autotest* 18 rm autotest*
19 19
20 20
21 if [ $found = 0 ]; then 21 if [ $FOUND = NO ]; then
22 echo 'int main() { printf("%d", 8 * sizeof(void *)); return 0; }' \ 22 FOUND="uint`expr 8 \* $NGX_PTR_BYTES`_t"
23 > autotest.c 23 echo " + $FOUND used"
24 eval "${CC} -o autotest autotest.c > /dev/null 2>&1" 24 echo "typedef $FOUND uintptr_t;" >> $NGX_AUTO_CONFIG_H
25 25 echo >> $NGX_AUTO_CONFIG_H
26 if [ -x autotest ]; then
27 type="uint`./autotest`_t"
28 echo " + $type used"
29 type="typedef $type uintptr_t;"
30 found=2
31 fi
32
33 rm autotest*
34 fi 26 fi
35
36
37 if [ $found = 0 ]; then
38 echo "$0: error: uintptr_t not found"
39 exit 1
40 fi
41
42
43 if [ $found = 2 ]; then
44 echo $type >> ngx_auto_config.h
45 echo >> ngx_auto_config.h
46 fi
47