summaryrefslogtreecommitdiffhomepage
path: root/auto/types
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-20 17:36:43 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-20 17:36:43 +0000
commit1ef225254ef3f7fc5470289bdeabad2e31507d55 (patch)
tree5a11f95ce27d89ff01dbd75305fe5dd41857ad4f /auto/types
parentbb6ec8c9fd4d23848ac3dddb1296d8fac5c99da8 (diff)
downloadnginx-1ef225254ef3f7fc5470289bdeabad2e31507d55.tar.gz
nginx-1ef225254ef3f7fc5470289bdeabad2e31507d55.tar.bz2
nginx-0.0.1-2003-11-20-20:36:43 import
Diffstat (limited to 'auto/types')
-rw-r--r--auto/types/longlong31
-rw-r--r--auto/types/sizeof31
-rw-r--r--auto/types/typedef32
-rw-r--r--auto/types/uintptr_t2
4 files changed, 96 insertions, 0 deletions
diff --git a/auto/types/longlong b/auto/types/longlong
new file mode 100644
index 000000000..f843d5ae4
--- /dev/null
+++ b/auto/types/longlong
@@ -0,0 +1,31 @@
+
+echo "Checking for long long size"
+
+BYTES=
+
+echo "int main() {" > autotest.c
+echo "printf(\"%d\", sizeof(long long));" >> autotest.c
+echo "return 0; }" >> autotest.c
+
+eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
+
+if [ -x ./autotest ]; then
+ BYTES=`./autotest`
+ echo " + long long is $BYTES bytes"
+fi
+
+rm autotest*
+
+case $BYTES in
+ 4)
+ NGX_MAX_LONG_LONG=4294967295
+ ;;
+
+ 8)
+ NGX_MAX_LONG_LONG=18446744073709551615
+ ;;
+
+ *)
+ echo "$0: error: can not detect long long size"
+ exit 1
+esac
diff --git a/auto/types/sizeof b/auto/types/sizeof
new file mode 100644
index 000000000..f24f4b67d
--- /dev/null
+++ b/auto/types/sizeof
@@ -0,0 +1,31 @@
+
+echo "Checking for $NGX_TYPE size"
+
+BYTES=
+
+echo "int main() {" > autotest.c
+echo "printf(\"%d\", sizeof($NGX_TYPE));" >> autotest.c
+echo "return 0; }" >> autotest.c
+
+eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
+
+if [ -x ./autotest ]; then
+ BYTES=`./autotest`
+ echo " + $NGX_TYPE is $BYTES bytes"
+fi
+
+rm autotest*
+
+case $BYTES in
+ 4)
+ NGX_MAX_SIZE=4294967295
+ ;;
+
+ 8)
+ NGX_MAX_SIZE=18446744073709551615
+ ;;
+
+ *)
+ echo "$0: error: can not detect $NGX_TYPE size"
+ exit 1
+esac
diff --git a/auto/types/typedef b/auto/types/typedef
new file mode 100644
index 000000000..4c7acbd11
--- /dev/null
+++ b/auto/types/typedef
@@ -0,0 +1,32 @@
+
+echo "Checking for $NGX_TYPE definition"
+
+echo "#include <sys/types.h>" > autotest.c
+TYPE=`${CPP} autotest.c | \
+ awk "/^typedef.*$NGX_TYPE/ { for (i = 1; i< NF; i++) print $i}"`
+#rm autotest.c
+
+echo $TYPE
+
+case $TYPE in
+ "long long")
+ echo ' + defined as long long'
+ NGX_FMT=$NGX_LONG_LONG_FMT
+ ;;
+
+ long)
+ echo ' + defined as long'
+ NGX_FMT=$NGX_LONG_FMT
+ ;;
+
+ int)
+ echo ' + defined as int'
+ NGX_FMT=$NGX_INT_FMT
+ ;;
+
+ *)
+ echo "$0: error: unknown $NGX_TYPE definition: \"$TYPE\""
+ exit 1
+ ;;
+
+esac
diff --git a/auto/types/uintptr_t b/auto/types/uintptr_t
index f2cfe6225..568c6099d 100644
--- a/auto/types/uintptr_t
+++ b/auto/types/uintptr_t
@@ -29,6 +29,8 @@ if [ $found = 0 ]; then
type="typedef $type uintptr_t;"
found=2
fi
+
+ rm autotest*
fi