diff auto/types/sizeof @ 193:dd66383796a5

nginx-0.0.1-2003-11-20-20:36:43 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 20 Nov 2003 17:36:43 +0000
parents
children 2357fa41738a
line wrap: on
line diff
new file mode 100644
--- /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