diff options
Diffstat (limited to 'auto/types/time_t')
| -rw-r--r-- | auto/types/time_t | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/auto/types/time_t b/auto/types/time_t new file mode 100644 index 000000000..ecd80ef18 --- /dev/null +++ b/auto/types/time_t @@ -0,0 +1,30 @@ + +echo "Checking for printf() time_t format" + +echo '#include <sys/types.h>' > autotest.c +type=`${CPP} autotest.c | awk '/^typedef.*time_t/ {print \$2}'` +rm autotest.c + +case $type in + long) + echo ' + long: "%ld" used' + fmt='"%ld"' + ;; + + int) + echo ' + int: "%d" used' + fmt='"%d"' + ;; + + *) + echo "$0: error: unknown time_t definition: \"$type\"" + exit 1 + ;; + +esac + + +echo "#ifndef TIME_FMT" >> ngx_auto_config.h +echo "#define TIME_FMT $fmt" >> ngx_auto_config.h +echo "#endif" >> ngx_auto_config.h +echo >> ngx_auto_config.h |
