OSDN Git Service

* java/util/Hashtable.java (Enumerator): Ensure that if
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / fixincl.tpl
1 [= AutoGen5 Template -*- Mode: C -*-
2 x=fixincl.x =]
3 /*
4  *  DO NOT EDIT THIS FILE - it has been generated
5  *
6  * Install modified versions of certain ANSI-incompatible system header
7  * files which are fixed to work correctly with ANSI C and placed in a
8  * directory that GNU C will search.
9  *
10  * This file contains [=(count "fix")=] fixup descriptions.
11  *
12  * See README for more information.
13  *
14  *  inclhack copyright (c) 1998, 1999, 2000, 2001
15  *  The Free Software Foundation, Inc.
16  *
17  [=(define re-ct 0) (define max-mach 0) (define ct 0)
18    (define HACK "") (define Hack "")    (define tmp "")
19    (gpl "inclhack" " *  ")=]
20  */
21 [=
22
23 FOR fix =]
24 /* * * * * * * * * * * * * * * * * * * * * * * * * *
25  *
26  *  Description of [=
27     (set! Hack (string-capitalize! (get "hackname")))
28     (set! HACK (string-upcase!     (get "hackname")))
29     (if (and (not (exist? "test_text")) (not (exist? "replace")))
30         (error (sprintf "include fix '%s' has no test text" Hack )) )
31     (. Hack)=] fix
32  */[=
33
34 # Note that this is not just for debugging purposes, but in case
35   some C fix wishes to refer to the regexps it is paired with.
36   See commentary at the top of fixfixes.c.
37 =]
38 tSCC z[=(. Hack)=]Name[] =
39      "[=hackname=]";
40
41 /*
42  *  File name selection pattern
43  */[=
44
45   IF (exist? "files")=]
46 tSCC z[=(. Hack)=]List[] =
47   "[=FOR files =]|[=files=][=ENDFOR=]|";[=
48
49   ELSE =]
50 #define z[=(. Hack)=]List (char*)NULL[=
51   ENDIF (exist? "files") =]
52 /*
53  *  Machine/OS name selection pattern
54  */[=
55
56   IF (exist? "mach")=]
57 tSCC* apz[=(. Hack)=]Machs[] = {[=
58     (set! ct 0) =][=
59
60     FOR mach =]
61         [=
62       (set! tmp (get "mach"))
63       (set! ct (+ ct (string-length tmp) 5))
64       (kr-string tmp)=],[=
65     ENDFOR=]
66         (const char*)NULL };[=
67
68     (if (> ct max-mach) (set! max-mach ct)) =][=
69
70   ELSE =]
71 #define apz[=(. Hack)=]Machs (const char**)NULL[=
72   ENDIF (exist? "files") =][=
73
74   IF (exist? "select")=]
75
76 /*
77  *  content selection pattern - do fix if pattern found
78  */[=
79     FOR select =]
80 tSCC z[=(. Hack)=]Select[=(for-index)=][] =
81        [=(kr-string (get "select"))=];[=
82     ENDFOR select =][=
83   ENDIF =][=
84
85   IF (exist? "bypass")=]
86
87 /*
88  *  content bypass pattern - skip fix if pattern found
89  */[=
90     FOR bypass =]
91 tSCC z[=(. Hack)=]Bypass[=(for-index)=][] =
92        [=(kr-string (get "bypass"))=];[=
93     ENDFOR bypass =][=
94   ENDIF =][=
95
96   IF (exist? "test")=]
97
98 /*
99  *  perform the 'test' shell command - do fix on success
100  */[=
101     FOR test =]
102 tSCC z[=(. Hack)=]Test[=(for-index)=][] =
103        [=(kr-string (get "test"))=];[=
104     ENDFOR  =][=
105   ENDIF     =][=
106
107   IF (exist? "c_test")=]
108
109 /*
110  *  perform the C function call test
111  */[=
112     FOR c_test =]
113 tSCC z[=(. Hack)=]FTst[=(for-index)=][] = "[=c_test=]";[=
114     ENDFOR c_test =][=
115   ENDIF =][=
116
117   IF (set! ct (+ (count "select") (count "bypass") 
118               (count "test") (count "c_test")))
119
120      (= ct 0)
121 =]
122 #define [=(. HACK)=]_TEST_CT  0
123 #define a[=(. Hack)=]Tests   (tTestDesc*)NULL[=
124   ELSE =]
125
126 #define    [=(. HACK)=]_TEST_CT  [=(. ct)=][=
127         (set! re-ct (+ re-ct (count "select") (count "bypass"))) =]
128 static tTestDesc a[=(. Hack)=]Tests[] = {[=
129
130     FOR test =]
131   { TT_TEST,     z[=(. Hack)=]Test[=(for-index)=],   0 /* unused */ },[=
132     ENDFOR test =][=
133
134     FOR c_test =]
135   { TT_FUNCTION, z[=(. Hack)=]FTst[=(for-index)=],   0 /* unused */ },[=
136     ENDFOR c_test =][=
137
138     FOR bypass =]
139   { TT_NEGREP,   z[=(. Hack)=]Bypass[=(for-index)=], (regex_t*)NULL },[=
140     ENDFOR bypass =][=
141
142     FOR select =]
143   { TT_EGREP,    z[=(. Hack)=]Select[=(for-index)=], (regex_t*)NULL },[=
144     ENDFOR select =] };[=
145   ENDIF =]
146
147 /*
148  *  Fix Command Arguments for [=(. Hack)=]
149  */
150 static const char* apz[=(. Hack)=]Patch[] = {[=
151     IF   (exist? "sed")=] "sed"[=
152       FOR sed=],
153     "-e", [=(kr-string (get "sed"))=][=
154       ENDFOR sed=],[=
155
156     ELIF (exist? "shell")=] "sh", "-c",
157     [=(kr-string (get "shell"))=],[=
158
159     ELIF (exist? "c_fix")=]
160     [=(kr-string (get "c_fix"))=],[=
161
162       FOR c_fix_arg =]
163     [=(kr-string (get "c_fix_arg"))=],[=
164       ENDFOR c_fix_arg =][=
165
166     ELIF (> (len "replace") 0) =]
167 [=(kr-string (get "replace"))=],[=
168
169     ENDIF=]
170     (char*)NULL };
171 [=ENDFOR fix=]
172
173 /* * * * * * * * * * * * * * * * * * * * * * * * * *
174  *
175  *  List of all fixes
176  */[=
177 #  as of this writing, 49 bytes are needed by the case statement format.
178    We also must allow for the size of the target machine machine name.
179    This allows for a 79 byte machine name.  Better be enough.
180 =]
181 #define REGEX_COUNT          [= (. re-ct) =]
182 #define MACH_LIST_SIZE_LIMIT [= (+ 128 max-mach) =]
183 #define FIX_COUNT            [= (count "fix") =]
184
185 /*
186  *  Enumerate the fixes[= # in a way that minimizes diffs :-) =]
187  */
188 typedef enum {[=
189
190 FOR fix "," =]
191     [=(string-upcase! (get "hackname"))=]_FIXIDX[=
192 ENDFOR
193
194 =]
195 } t_fixinc_idx;
196
197 tFixDesc fixDescList[ FIX_COUNT ] = {[=
198
199
200 FOR fix ",\n" =][=
201     (set! Hack (string-capitalize! (get "hackname")))
202     (set! HACK (string-upcase!     (get "hackname"))) =]
203   {  z[=(. Hack)=]Name,    z[=(. Hack)=]List,
204      apz[=(. Hack)=]Machs,
205      [=(. HACK)=]_TEST_CT, [=
206        IF (exist? "not_machine") =]FD_MACH_IFNOT[=
207        ELSE                      =]FD_MACH_ONLY[=
208        ENDIF =][=
209        IF    (exist? "shell")    =] | FD_SHELL_SCRIPT[=
210        ELIF  (exist? "c_fix")    =] | FD_SUBROUTINE[=
211        ELIF  (exist? "replace")  =] | FD_REPLACEMENT[=
212        ENDIF =],
213      a[=(. Hack)=]Tests,   apz[=(. Hack)=]Patch, 0 }[=
214
215 ENDFOR =]
216 };