Mercurial > hg > nginx-quic
annotate auto/fmt/ptrfmt @ 333:be40e9893a19
nginx-0.0.3-2004-05-11-20:16:13 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 11 May 2004 16:16:13 +0000 |
parents | f082cb6bcdd7 |
children | 54f76b0b8dca |
rev | line source |
---|---|
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2 echo $ngx_n "checking for $ngx_type printf() format ..." $ngx_c |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
3 echo >> $NGX_ERR |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
4 echo "checking for $ngx_type printf() format" >> $NGX_ERR |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
5 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
6 ngx_fmt=no |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 comma= |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 fmtX= |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 for fmt in $ngx_formats |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 do |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 cat << END > $NGX_AUTOTEST.c |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 int main() { |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
16 printf("$fmt", ($ngx_type) $ngx_max_size); |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
17 return 0; |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
18 } |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
19 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
20 END |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
21 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
22 eval "$CC_WARN $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c \ |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
23 >> $NGX_ERR 2>&1" |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
24 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
25 max_size=`echo $ngx_max_size | sed -e "s/L*\$//"` |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
26 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
27 if [ -x $NGX_AUTOTEST ]; then |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
28 if [ "`$NGX_AUTOTEST`" = $max_size ]; then |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
29 ngx_fmt=$fmt |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
30 fi |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
31 fi |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
32 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
33 rm $NGX_AUTOTEST* |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
34 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
35 if [ $ngx_fmt != no ]; then |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
36 break |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
37 fi |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
38 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
39 fmtX=`echo $fmt | sed -e "s/d/X/"` |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
40 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
41 echo $ngx_n "$comma \"${fmtX}\" is not appropriate" $ngx_c |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
42 comma="," |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
43 done |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
44 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
45 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
46 if [ $ngx_fmt = no ]; then |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
47 echo "$0: error: printf() $ngx_type format not found" |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
48 exit 1 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
49 fi |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
50 |
268
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
51 |
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
52 if [ $ngx_ptr_bytes = 4 ]; then |
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
53 fmtX="%0`expr 2 \* $ngx_ptr_bytes`" |
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
54 else |
269
f082cb6bcdd7
nginx-0.0.2-2004-02-25-18:46:57 import
Igor Sysoev <igor@sysoev.ru>
parents:
268
diff
changeset
|
55 fmtX="%" |
268
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
56 fi |
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
57 |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
58 ngx_fmt=`echo $ngx_fmt | sed -e "s/d/X/" -e "s/^%/$fmtX/"` |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
60 echo "$comma \"${ngx_fmt}\" used" |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
61 |
268
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
62 |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
63 cat << END >> $NGX_AUTO_CONFIG_H |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
64 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
65 #ifndef $ngx_fmt_name |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
66 #define $ngx_fmt_name "$ngx_fmt" |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
67 #endif |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
68 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
69 END |