OSDN Git Service

IRIX 5.2's <sys/asm.h> contains an asm comment with an apostrophe
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / inclhack.def
1 /* -*- Mode: C -*-  */
2
3 autogen definitions inclhack;
4
5 /*
6
7 Define all the fixes we know about for repairing damaged headers
8
9 The rules for making fixes:
10
11 1.  Every fix must have a "hackname" that is compatible with C syntax
12     for variable names and is unique without regard to alphabetic case.
13
14 2.  If the problem is known to exist only in certain files,
15     then name each such file with a "files = " entry.
16
17 3.  It is relatively expensive to fire off a process to fix a source
18     file, therefore write apply tests to avoid unnecessary fix
19     processes.  The preferred apply tests are "select" and "bypass"
20     because they are performed internally.  "test" sends a command
21     to a server shell that actually fires off one or more processes
22     to do the testing.  Avoid it, if you can, but it is still more
23     efficient than a fix process.
24
25     These tests are required to:
26
27     1.  Be positive for all header files that require the fix.
28
29     It is desireable to:
30
31     2.  Be negative as often as possible whenever the fix is not
32         required, avoiding the process overhead.
33
34     It is nice if:
35
36     3.  The expression is as simple as possible to both
37         process and uderstand by people.  :-)
38
39         Please take advantage of the fact AutoGen will glue
40         together string fragments.  It helps.  Also take note
41         that double quote strings and single quote strings have
42         different formation rules.  Double quote strings are
43         a tiny superset of C string syntax.  Single quote strings
44         follow shell single quote string formation rules, except
45         that the backslash is processed before '\\', '\'' and '#'
46         characters (using C character syntax).
47
48 4.  There are currently two methods of fixing a file:
49
50     1.  a series of sed expressions.  Each will be an individual
51         "-e" argument to a single invocation of sed.
52
53     2.  a shell script.  These scripts are _required_ to read all
54         of stdin in order to avoid pipe stalls.  They may choose to
55         discard the input.
56
57     A C language subroutine method is planned for both tests and fixes
58     in the near term.  Awk ought to be possible too, but there may
59     be portability issues that I am not familiar with.
60
61 5.  If the fix is to remove the file (i.e. the fixing process broke
62     the file), then you must use a shell script that deletes all
63     copies of the output file and does not write _anything_ to stdout.
64     See the "zzz_*" fixes at the end of this file.
65
66 Let the fixes begin: */
67
68 /*
69  *  sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the definition
70  *  of struct rusage, so the prototype (added by fixproto) causes havoc.
71  */
72 fix = {
73     hackname = aix_syswait;
74     files    = sys/wait.h;
75     select = "bos325,";
76     sed    = "/^extern pid_t wait3();$/i\\\n"
77              "struct rusage;\n";
78 };
79
80
81 /*
82  *  sys/signal.h on some versions of AIX uses volatile in the typedef of
83  *  sig_atomic_t, which causes gcc to generate a warning about duplicate
84  *  volatile when a sig_atomic_t variable is declared volatile, as
85  *  required by ANSI C.
86  */
87 fix = {
88     hackname = aix_volatile;
89     files    = sys/signal.h;
90     select   = "typedef volatile int sig_atomic_t";
91     sed      = "s/typedef volatile int sig_atomic_t"
92                 "/typedef int sig_atomic_t/";
93 };
94
95
96 /*
97  *  Fix getopt declarations in stdio.h and stdlib.h on Alpha OSF/1 and AIX.
98  */
99 fix = {
100     hackname = alpha_getopt;
101     files  = "stdio.h";
102     files  = "stdlib.h";
103     select = 'getopt\(int, char \*\[';
104     sed    = 's/getopt(int, char \*\[\],[ ]*char \*)/'
105                'getopt(int, char *const[], const char *)/';
106 };
107
108
109 /* 
110  * Remove erroneous parentheses in sym.h on Alpha OSF/1.
111  */
112 fix = {
113     hackname = alpha_parens;
114     files    = sym.h;
115     select   = '#ifndef\(__mips64\)';
116     sed      = "s/#ifndef(__mips64)/#ifndef __mips64/";
117 };
118
119
120 /*
121  *  Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
122  */
123 fix = {
124     hackname = alpha_sbrk;
125     files    = unistd.h;
126     select   = "char[ \t]*\\*[\t ]*sbrk[ \t]*\\(";
127     sed  = "s/char\\([ \t]*\\*[\t ]*sbrk[ \t]*(\\)/void\\1/";
128 };
129
130
131 /*
132  *  Fix this ARM/RISCiX file where ___type is a Compiler
133  *  hint that is specific to the Norcroft compiler.
134  */
135 fix = {
136     hackname = arm_norcroft_hint;
137     select   = "___type p_type";
138     files    = "X11/Intrinsic.h";
139     sed      = "s/___type p_type/p_type/";
140 };
141
142
143 /*
144  *  Fix this ARM/RISCiX file to avoid interfering
145  *  with the use of __wchar_t in cc1plus.
146  */
147 fix = {
148     hackname = arm_wchar;
149     files  = stdlib.h;
150     select = "#[ \t]*define[ \t]*__wchar_t";
151     sed    = "s/\\(#[ \t]*ifndef[ \t]*\\)__wchar_t/\\1_GCC_WCHAR_T/";
152     sed    = "s/\\(#[ \t]*define[ \t]*\\)__wchar_t/\\1_GCC_WCHAR_T/";
153 };
154
155
156 /*
157  *  This file in A/UX 3.0.x/3.1.x contains an __asm directive for c89;
158  *  gcc doesn't understand it.
159  */
160 fix = {
161     hackname = aux_asm;
162     files    = sys/param.h;
163     select   = "#ifndef NOINLINE";
164     sed      = "s|#ifndef NOINLINE"
165                 "|#if !defined(NOINLINE) \\&\\& !defined(__GNUC__)|";
166 };
167
168
169 /*
170  *  For C++, avoid any typedef or macro definition of bool,
171  *  and use the built in type instead.
172  *  HP/UX 10.20 also has it in curses_colr/curses.h.
173  */
174 fix = {
175     hackname = avoid_bool;
176     files    = curses.h;
177     files    = curses_colr/curses.h;
178     files    = term.h;
179     files    = tinfo.h;
180
181     sed = "/^#[ \t]*define[ \t][ \t]*bool[ \t][ \t]*char[ \t]*$/i\\\n"
182                 "#ifndef __cplusplus\n";
183
184     sed = "/^#[ \t]*define[ \t][ \t]*bool[ \t][ \t]*char[ \t]*$/a\\\n"
185                 "#endif\n";
186
187     sed = "/^typedef[ \t][ \t]*char[ \t][ \t]*bool[ \t]*;/i\\\n"
188                 "#ifndef __cplusplus\n";
189
190     sed = "/^typedef[ \t][ \t]*char[ \t][ \t]*bool[ \t]*;/a\\\n"
191                 "#endif\n";
192
193     sed = "/^[ ]*typedef[ \t][ \t]*unsigned char[ \t][ \t]*bool[ \t]*;/i\\\n"
194                 "#ifndef __cplusplus\n";
195
196     sed = "/^[ ]*typedef[ \t][ \t]*unsigned char[ \t][ \t]*bool[ \t]*;/a\\\n"
197                 "#endif\n";
198
199     sed = "/^typedef[ \t][ \t]*int[ \t][ \t]*bool[ \t]*;/i\\\n"
200                 "#ifndef __cplusplus\n";
201
202     sed = "/^typedef[ \t][ \t]*int[ \t][ \t]*bool[ \t]*;/a\\\n"
203                 "#endif\n";
204
205     sed = "/^[ ]*typedef[ \t][ \t]*unsigned int[ \t][ \t]*bool[ \t]*;/i\\\n"
206                 "#ifndef __cplusplus\n";
207
208     sed = "/^[ ]*typedef[ \t][ \t]*unsigned int[ \t][ \t]*bool[ \t]*;/a\\\n"
209                 "#endif\n";
210 };
211
212
213 /*
214  *  Fix `typedef struct term;' on hppa1.1-hp-hpux9.
215  */
216 fix = {
217     hackname = bad_struct_term;
218     files  = curses.h;
219     select = "^[ \t]*typedef[ \t]+struct[ \t]+term[ \t]*;";
220     sed    = "s/^[ \t]*typedef[ \t][ \t]*"
221              "\\(struct[ \t][ \t]*term[ \t]*;[ \t]*\\)$/\\1/";
222 };
223
224
225 /*
226  *  Fix one other error in this file:
227  *  a mismatched quote not inside a C comment.
228  */
229 fix = {
230     hackname = badquote;
231     files    = sundev/vuid_event.h;
232     sed      = "s/doesn't/does not/";
233 };
234
235
236 /*
237  *  Fix #defines under Alpha OSF/1:
238  *  The following files contain '#pragma extern_prefix "_FOO"' followed by
239  *  a '#define something(x,y,z) _FOOsomething(x,y,z)'.  The intent of these
240  *  statements is to reduce namespace pollution.  While these macros work
241  *  properly in most cases, they don't allow you to take a pointer to the
242  *  "something" being modified.  To get around this limitation, change these
243  *  statements to be of the form '#define something _FOOsomething'.
244  */
245 fix = {
246     hackname = bad_lval;
247     files    = libgen.h;
248     files    = dirent.h;
249     files    = ftw.h;
250     files    = grp.h;
251     files    = ndbm.h;
252     files    = pthread.h;
253     files    = pwd.h;
254     files    = signal.h;
255     files    = standards.h;
256     files    = stdlib.h;
257     files    = string.h;
258     files    = stropts.h;
259     files    = time.h;
260     files    = unistd.h;
261     sed      =
262         "s/^[ \t]*#[ \t]*define[ \t]*\\([^(]*\\)\\(([^)]*)\\)[ \t]*"
263                "\\(_.\\)\\1\\2[ \t]*$/#define \\1 \\3\\1/";
264 };
265
266
267 /*
268  *  check for broken assert.h that needs stdio.h
269  */
270 fix = {
271     hackname = broken_assert_stdio;
272     files    = assert.h;
273     select   = stderr;
274     bypass   = "include.*stdio.h";
275     sed      = "1i\\\n"
276                "#include <stdio.h>\n";
277 };
278
279
280 /*
281  *  check for broken assert.h that needs stdlib.h
282  */
283 fix = {
284     hackname = broken_assert_stdlib;
285     files    = assert.h;
286     select   = 'exit *\(|abort *\(';
287     bypass   = "include.*stdlib.h";
288     sed      = "1i\\\n"
289                "#ifdef __cplusplus\\\n"
290                "#include <stdlib.h>\\\n"
291                "#endif\n";
292 };
293
294
295 /*
296  *  Note that BSD43_* are used on recent MIPS systems.
297  */
298 fix = {
299     hackname = bsd43_io_macros;
300     select   = "BSD43__IO";
301     /*
302      *  Put single quotes aroung the character that appears after '('
303      *  and before ',', UNLESS it is a 'c' or 'g' or 'x'.
304      */
305     sed = "/[ \t]BSD43__IO[A-Z]*[ \t]*(/"       's/(\(.\),/(\'\1\',/';
306     sed = "/#[ \t]*define[ \t]*[ \t]BSD43__IO/" 's/\'\([cgx]\)\'/\1/g';
307 };
308
309
310 /*
311  *  Fix <c_asm.h> on Digital UNIX V4.0:
312  *  It contains a prototype for a DEC C internal asm() function,
313  *  clashing with gcc's asm keyword.  So protect this with __DECC.
314  */
315 fix = {
316     hackname = dec_intern_asm;
317     files    = c_asm.h;
318     sed = "/^[ \t]*float[ \t]*fasm/i\\\n#ifdef __DECC\n";
319     sed = "/^[ \t]*#[ \t]*pragma[ \t]*intrinsic([ \t]*dasm/a\\\n"
320           "#endif\n";
321 };
322
323
324 /*
325  *  Completely replace &lt;_int_varargs.h&gt; with a file that includes gcc's
326  *  stdarg.h or varargs.h files as appropriate on DG/UX
327  */
328 fix = {
329     hackname = dgux_int_varargs;
330     files    = _int_varargs.h;
331     shell    = "cat > /dev/null\ncat << '_EOF_'
332 \#ifndef __INT_VARARGS_H
333 \#define __INT_VARARGS_H
334
335 /************************************************************************/
336 /* _INT_VARARGS.H - Define the common stuff for varargs/stdarg/stdio.   */
337 /************************************************************************/
338
339 /*
340 ** This file is a DG internal header.  Never include this
341 ** file directly.
342 */
343
344 \#ifndef ___int_features_h
345 \#include &lt;sys/_int_features.h&gt;
346 \#endif
347
348 \#if !(defined(_VA_LIST) || defined(_VA_LIST_))
349 \#define _VA_LIST
350 \#define _VA_LIST_
351
352 \#ifdef __LINT__
353
354 \#ifdef __STDC__
355 typedef void * va_list;
356 \#else
357 typedef char * va_list;
358 \#endif
359
360 \#else
361 \#if _M88K_ANY
362
363 \#if defined(__DCC__)
364
365 typedef struct {
366       int     next_arg;
367       int     *mem_ptr;
368       int     *reg_ptr;
369 } va_list;
370
371 \#else  /* ! defined(__DCC__) */
372
373 typedef struct {
374       int  __va_arg;       /* argument number */
375       int *__va_stk;       /* start of args passed on stack */
376       int *__va_reg;       /* start of args passed in regs */
377 } va_list;
378
379 \#endif  /* ! defined(__DCC__) */
380
381 \#elif _IX86_ANY
382
383 \#if defined(__GNUC__) || defined(__STDC__)
384 typedef void * va_list;
385 \#else
386 typedef char * va_list;
387 \#endif
388
389 \#endif  /*  _IX86_ANY */
390
391 \#endif /* __LINT__ */
392 \#endif /*  !(defined(_VA_LIST) || defined(_VA_LIST_)) */
393 \#endif /*  #ifndef __INT_VARARGS_H  */
394 _EOF_\n";
395 };
396
397
398 /*
399  *  Remove the double-slash comments
400  *  They *must* be removed so it will not create nested comments!!
401  *  However, they will *not* be removed if the file name ends with
402  *  any of "++", ".hh" or ".H", or if the file name contains "cxx/".
403  *
404  *  There *used* to be a number of similar problems in various OSes:
405
406  *  Turning // comments into normal comments trashes this IRIX 4.0.1
407  *  header file, which embeds // comments inside multi-line
408  *  comments.  If this looks like the IRIX header file, we refix it by
409  *  just throwing away the // comments.
410
411  *  Same problem with a file from SunOS 4.1.3 : a header file containing
412  *  the string "//" embedded in "/ * * /"
413
414  *  There is a similar problem with the VxWorks drv/netif/if_med.h file.
415
416  *  And also with the HP-UX 10 and HP-UX 11 sys/pci.h file
417
418  *  Now that we delete the // comments instead of converting them to / * * /,
419  *  traditional hacks like irix_bogus_cxx_cmnt, no longer work (which
420  *  strangely enough was also used on alpha-dec-osf4.0d).  If we skip the
421  *  hack whenever we see ``"//"' ', then the need for the secondary hack
422  *  disappears.  Note: it is painful to ensure that the first quote
423  *  exists, so we just check for the trailing quote directly abutting
424  *  the //.  Note: We should never touch a line that has // completely
425  *  within quotes but this is somewhat hard to check for.
426
427  *  Ultimately, this fix ought to go inside of C code where
428  *  we can do a better analysis on the need and method for fixing.
429  */
430 fix = {
431     hackname = no_double_slash;
432     /*
433      *  Test that the file-to-fix does not from a C++ directory
434      *  Also, only accept double slashes that are not part of URL's
435      *  and are not the end of a quoted string.
436      */
437     test   = ' -z "`echo ${file} | egrep \'(CC|cxx|\+\+)/\'`"';
438     select = '(^|[^:])//[^"*]';
439     sed    = 's,^//.*$,,';
440     sed    = 's,[^:]//[^"].*$,,';
441 };
442
443
444 /*
445  * Fix these Sun OS files to avoid an invalid identifier in an #ifdef.
446  */
447 fix = {
448     hackname = ecd_cursor;
449     files  = "sunwindow/win_lock.h";
450     files  = "sunwindow/win_cursor.h";
451     sed    = "s/ecd.cursor/ecd_cursor/";
452 };
453
454 /*
455  *  On SCO OpenServer 5.0.0 through (at least) 5.0.5 <sys/stat.h> contains
456  *  tiny static wrappers that aren't C++ safe.
457  */
458 fix = {
459     hackname = sco5_stat_wrappers;
460     mach     = "i*86-*-sco3.2v5*";
461     files    = "sys/stat.h";
462
463     sed = "/^static int[ \t]*[a-z]*stat(/i\\\n"
464         "#ifdef __cplusplus\\\n"
465         "extern \"C\"\\\n"
466         "{\\\n"
467         "#endif\\\n";
468
469     sed = "/^}$/a\\\n"
470         "#ifdef __cplusplus\\\n"
471         "}\\\n"
472         "#endif \/* __cplusplus *\/\\\n";
473 };
474
475
476
477 /*
478  *  Fix else and endif directives that contain non-commentary text
479  */
480 fix = {
481     hackname = end_else_label;
482
483     /*
484      *  Select files that contain '#endif' or '#else' directives with
485      *  some sort of following junk.  (Between the ascii '.'
486      *  and '0' lies the character '/'.  This will *NOT*
487      *  match '#endif / * foo * /', but it also wont match
488      *  '#endif / done' either.
489      *
490      *  We have a second regexp in the selector to detect
491      *  #endif followed by a / followed by anything other
492      *  than a *.  For example "#endif / * foo * /" or 
493      *  "#endif /% blah %/ which appear on OSF4.0A and AIX4.2
494      *  repsectively.
495      * 
496      *  We use the pattern [!-.0-z{|}~] instead of [^/ \t] to match a
497      *  noncomment following #else or #endif because some buggy egreps
498      *  think [^/] matches newline, and they thus think `#else ' matches
499      *  `#e[ndiflse]*[ \t]+[^/ \t]'.
500      *  [!-.0-~] does not work properly on AIX 4.1.
501      */
502     select   = "^[ \t]*#[ \t]*(else|endif)[ \t]+"
503                "("  '[!-.0-z\{\|\}\~]'  "|"  '/[^\*]'  ")";
504
505     /*
506      *  First, join the continued input lines.
507      *  IF the resulting line is an endif preprocessing directive,
508      *  then trim off the following patterns:
509      *  1.  sequences that start with '/' and is *NOT* followed by '*'
510      *  2.  Sequences that start with '*' and is *NOT* followed by '/'
511      *  3.  sequences that do not start with any of '/', '*', '\t' or ' '.
512      *
513      * The fixinc_eol stuff is to work around a bug in the sed
514      */
515     sed =      ":loop\n"
516                '/\\\\$/'                       "N\n"
517                's/\\\\$/\\\\+++fixinc_eol+++/' "\n"
518                '/\\\\$/'                       "b loop\n"
519                's/\\\\+++fixinc_eol+++/\\\\/g' "\n"
520
521                "s%^\\([ \t]*#[ \t]*else\\)[ \t][ \t]*/[^*].*%\\1%\n"
522                "s%^\\([ \t]*#[ \t]*else\\)[ \t][ \t]*[^/ \t].*%\\1%\n"
523                "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*/[^*].*%\\1%\n"
524                "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*\\*[^/].*%\\1%\n"
525                "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*[^/* \t].*%\\1%";
526 };
527
528
529 /*
530  *  Fix HP's use of ../machine/inline.h to refer to
531  *    /usr/include/machine/inline.h
532  */
533 fix = {
534     hackname = hp_inline;
535     files  = sys/spinlock.h;
536     select = 'include.*"\.\./machine/';
537     sed    = "s,\"../machine/inline.h\",<machine/inline.h>,";
538     sed    = "s,\"../machine/psl.h\",<machine/psl.h>,";
539 };
540
541
542 /*
543  *  Check for (...) in C++ code in HP/UX sys/file.h.
544  */
545 fix = {
546     hackname = hp_sysfile;
547     files    = sys/file.h;
548     select   = "HPUX_SOURCE";
549     sed      = 's/(\.\.\.)/(struct file * ...)/';
550 };
551
552
553 /*
554  *  sys/mman.h on HP/UX is not C++ ready,
555  *  even though NO_IMPLICIT_EXTERN_C is defined on HP/UX.
556  *
557  *  rpc/types.h on OSF1/2.0 is not C++ ready, even though NO_IMPLICIT_EXTERN_C
558  *  is defined for the alpha.  The problem is the declaration of malloc.
559  */
560 fix = {
561     hackname = cxx_unready;
562     files    = sys/mman.h;
563     files    = rpc/types.h;
564     bypass = '"C"|__BEGIN_DECLS';
565
566     sed      = "1i\\\n"
567                "#ifdef __cplusplus\\\n"
568                "extern \"C\" {\\\n"
569                "#endif\\\n\n";
570     sed      = "$a\\\n"
571                "#ifdef __cplusplus\\\n"
572                "}\\\n"
573                "#endif\n";
574 };
575
576
577 /*
578  *  HPUX 10.x sys/param.h defines MAXINT which clashes with values.h
579  */
580 fix = {
581     hackname = hpux_maxint;
582     files    = sys/param.h;
583     sed      = "/^#[ \t]*define[ \t]*MAXINT[ \t]/i\\\n"
584                "#ifndef MAXINT\n";
585
586     sed      = "/^#[ \t]*define[ \t]*MAXINT[ \t]/a\\\n"
587                "#endif\n";
588 };
589
590
591 /*
592  *  Fix hpux10.20 <sys/time.h> to avoid invalid forward decl
593  */
594 fix = {
595     hackname = hpux_systime;
596     files    = sys/time.h;
597     select   = "^extern struct sigevent;";
598     sed      = "s/^extern struct sigevent;/struct sigevent;/";
599 };
600
601
602 /*
603  *  Determine if we're on Interactive Unix 2.2 or later, in which case we
604  *  need to fix some additional files.  This is the same test for ISC that
605  *  Autoconf uses.  On Interactive 2.2, certain traditional Unix
606  *  definitions (notably getc and putc in stdio.h) are omitted if __STDC__
607  *  is defined, not just if _POSIX_SOURCE is defined.  This makes it
608  *  impossible to compile any nontrivial program except with -posix.
609  */
610 fix = {
611     hackname = interactv_add1;
612
613     test   = " -d /etc/conf/kconfig.d";
614     test   = ' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`"';
615
616     files  = "stdio.h";
617     files  = "math.h";
618     files  = "ctype.h";
619     files  = "sys/limits.h";
620     files  = "sys/fcntl.h";
621     files  = "sys/dirent.h";
622
623     sed    = "s/!defined(__STDC__) && !defined(_POSIX_SOURCE)/"
624                "!defined(_POSIX_SOURCE)/";
625 };
626
627 fix = {
628     hackname = interactv_add2;
629
630     test   = " -d /etc/conf/kconfig.d";
631     test   = ' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`"';
632
633     files  = math.h;
634     sed    = "s/fmod(double)/fmod(double, double)/";
635 };
636
637 fix = {
638     hackname = interactv_add3;
639
640     test   = " -d /etc/conf/kconfig.d";
641     test   = ' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`"';
642
643     files  = sys/limits.h;
644
645     sed    = "/CHILD_MAX/s,/\\* Max, Max,";
646     sed    = "/OPEN_MAX/s,/\\* Max, Max,";
647 };
648
649
650 /*
651  *  Fix various _IO* defines, but do *not* quote the characters cgxtf.
652  */
653 fix = {
654     hackname = io_def_quotes;
655     select = "[ \t]*[ \t](_|DES)IO[A-Z]*[ \t]*\\( *[^,']";
656     sed = "s/\\([ \t]*[ \t]_IO[A-Z]*[ \t]*(\\)\\([^,']\\),/\\1'\\2',/";
657     sed = "s/\\([ \t]*[ \t]DESIO[A-Z]*[ \t]*(\\)\\([^,']\\),/\\1'\\2',/";
658     sed = "/#[ \t]*define[ \t]*[ \t]_IO/"       "s/'\\([cgxtf]\\)'/\\1/g";
659     sed = "/#[ \t]*define[ \t]*[ \t]DESIOC/"    's/\'\([cdgx]\)\'/\1/g';
660 };
661
662
663 /*
664  *  Fix CTRL macros
665  *
666  * Basically, what is supposed to be happening is that every
667  * _invocation_ of the "_CTRL()" or "CTRL()" macros is supposed to have
668  * its argument inserted into single quotes.  We _must_ do this because
669  * ANSI macro substitution rules prohibit looking inside quoted strings
670  * for the substitution names.  A side effect is that the quotes are
671  * inserted in the definitions of those macros as well.  So, the last
672  * several sed expressions are supposed to clean up the definitions, as
673  * long as those definitions are using "c", "g" or "x" as the macro
674  * argument :).  Yuck.
675  */
676 fix = {
677     hackname = ioctl_fix_ctrl;
678     select = "CTRL[ \t]*\\(";
679
680     sed = "/[^A-Z0-9_]CTRL[ \t]*(/"
681               "s/\\([^']\\))/'\\1')/";
682
683     sed = "/[^A-Z0-9]_CTRL[ \t]*(/"
684               "s/\\([^']\\))/'\\1')/";
685
686     sed = "/#[ \t]*define[ \t]*[ \t]CTRL/"
687               "s/'\\([cgx]\\)'/\\1/g";
688
689     sed = "/#[ \t]*define[ \t]*[ \t]_CTRL/"
690               "s/'\\([cgx]\\)'/\\1/g";
691
692     sed = "/#[ \t]*define[ \t]*[ \t]BSD43_CTRL/"
693               "s/'\\([cgx]\\)'/\\1/g";
694
695     sed = "/#[ \t]*define[ \t]*[ \t][_]*ISCTRL/"
696               "s/'\\([cgx]\\)'/\\1/g";
697 };
698
699
700 /*
701  *  Check for missing ';' in struct
702  */
703 fix = {
704     hackname = ip_missing_semi;
705     files    = netinet/ip.h;
706     sed      = "/^struct/,/^};/s/}$/};/";
707 };
708
709
710 /*
711  *  IRIX 4.0.5 <rpc/auth.h> uses struct sockaddr
712  *  in prototype without previous definition.
713  */
714 fix = {
715     hackname = irix_multiline_cmnt;
716     files    = sys/types.h;
717
718     sed   = "s@type of the result@type of the result */@";
719     sed   = "s@of the sizeof@/* of the sizeof@";
720 };
721
722
723 /*
724  *  Some IRIX header files contain the string "//"
725  */
726 fix = {
727     hackname = irix_sockaddr;
728     files    = rpc/auth.h;
729     select   = "authdes_create.*struct sockaddr";
730     sed      = "/authdes_create.*struct sockaddr/i\\\n"
731                "struct sockaddr;\n";
732 };
733
734
735 /*
736  *  IRIX 4.0.5 <rpc/xdr.h> uses struct __file_s
737  *  in prototype without previous definition.
738  */
739 fix = {
740     hackname = irix_struct__file;
741     files = rpc/xdr.h;
742     sed   = "/xdrstdio_create.*struct __file_s/i\\\n"
743             "struct __file_s;\n";
744 };
745
746
747 /*
748  *  IRIX 5.2's <sys/asm.h> contains an asm comment with a contraction
749  *  that causes the assembly preprocessor to complain about an
750  *  unterminated character constant.
751  */
752 fix = {
753     hackname = irix_asm_apostrophe;
754     files    = sys/asm.h;
755
756     select   = "^[ \t]*#.*[Ww]e're";
757     sed      = "/^[ \t]*#/s/\\([Ww]e\\)'re/\\1 are/";
758 };
759
760
761 /*
762  * Fixing ISC fmod declaration
763  */
764 fix = {
765     hackname = isc_fmod;
766     files    = math.h;
767     select   = 'fmod\(double\)';
768     sed      = "s/fmod(double)/fmod(double, double)/";
769 };
770
771   
772 /*
773  * Fix nested comments in Motorola's <limits.h> and <sys/limits.h>
774  */
775 fix = {
776     hackname = motorola_nested;
777     mach     = "m68k-motorola-sysv*";
778     files    = limits.h;
779     files    = sys/limits.h;
780     sed = "s@^\\(#undef[ \t][ \t]*PIPE_BUF[ \t]*"
781                    "/\\* max # bytes atomic in write to a\\)$@\\1 */@";
782     sed = "s@\\(/\\*#define\tHUGE_VAL\t3.40282346638528860e+38 \\)"
783           "\\(/\\*error value returned by Math lib\\*/\\)$@\\1*/ \\2@";
784 };
785
786   
787 /*
788  * Fixing nested comments in ISC <sys/limits.h>
789  */
790 fix = {
791     hackname = isc_sys_limits;
792     files  = sys/limits.h;
793     select = CHILD_MAX;
794     sed    = "/CHILD_MAX/s,/\\* Max, Max,";
795     sed    = "/OPEN_MAX/s,/\\* Max, Max,";
796 };
797
798
799 /*
800  * These files in Sun OS 4.x and ARM/RISCiX and BSD4.3
801  * use / * * / to concatenate tokens.
802  */
803 fix = {
804     hackname = kandr_concat;
805     files  = "sparc/asm_linkage.h";
806     files  = "sun3/asm_linkage.h";
807     files  = "sun3x/asm_linkage.h";
808     files  = "sun4/asm_linkage.h";
809     files  = "sun4c/asm_linkage.h";
810     files  = "sun4m/asm_linkage.h";
811     files  = "sun4c/debug/asm_linkage.h";
812     files  = "sun4m/debug/asm_linkage.h";
813     files  = "arm/as_support.h";
814     files  = "arm/mc_type.h";
815     files  = "arm/xcb.h";
816     files  = "dev/chardefmac.h";
817     files  = "dev/ps_irq.h";
818     files  = "dev/screen.h";
819     files  = "dev/scsi.h";
820     files  = "sys/tty.h";
821     files  = "Xm.acorn/XmP.h";
822     files  = bsd43/bsd43_.h;
823     select = '/\*\*/';
824     sed    = 's|/\*\*/|##|g';
825 };
826
827
828 /*
829  *  In limits.h, put #ifndefs around things that are supposed to be defined
830  *  in float.h to avoid redefinition errors if float.h is included first.
831  *  On HP/UX this patch does not work, because on HP/UX limits.h uses
832  *  multi line comments and the inserted #endif winds up inside the
833  *  comment.  Fortunately, HP/UX already uses #ifndefs in limits.h; if
834  *  we find a #ifndef FLT_MIN we assume that all the required #ifndefs
835  *  are there, and we do not add them ourselves.
836  *  Also fix a nested comment problem in sys/limits.h on Motorola sysV68 R3V7.1
837  */
838 fix = {
839     hackname = limits_ifndefs;
840     files  = "limits.h";
841     files  = "sys/limits.h";
842     bypass = "ifndef[ \t]+FLT_MIN";
843
844     sed  = "/[ \t]FLT_MIN[ \t]/i\\\n#ifndef FLT_MIN\n";
845     sed  = "/[ \t]FLT_MIN[ \t]/a\\\n#endif\n";
846     sed  = "/[ \t]FLT_MAX[ \t]/i\\\n#ifndef FLT_MAX\n";
847     sed  = "/[ \t]FLT_MAX[ \t]/a\\\n#endif\n";
848     sed  = "/[ \t]FLT_DIG[ \t]/i\\\n#ifndef FLT_DIG\n";
849     sed  = "/[ \t]FLT_DIG[ \t]/a\\\n#endif\n";
850     sed  = "/[ \t]DBL_MIN[ \t]/i\\\n#ifndef DBL_MIN\n";
851     sed  = "/[ \t]DBL_MIN[ \t]/a\\\n#endif\n";
852     sed  = "/[ \t]DBL_MAX[ \t]/i\\\n#ifndef DBL_MAX\n";
853     sed  = "/[ \t]DBL_MAX[ \t]/a\\\n#endif\n";
854     sed  = "/[ \t]DBL_DIG[ \t]/i\\\n#ifndef DBL_DIG\n";
855     sed  = "/[ \t]DBL_DIG[ \t]/a\\\n#endif\n";
856     sed  = "/^\\(\\/\\*#define\tHUGE_VAL\t3\\.[0-9e+]* *\\)\\/\\*/s//\\1/";
857 };
858
859
860 /*
861  *  Delete the '#define void int' line from curses.h on Lynx
862  */
863 fix = {
864     hackname = lynx_void_int;
865     files    = curses.h;
866     select   = "#[ \t]*define[ \t]+void[ \t]+int";
867     sed      = "/#[ \t]*define[ \t][ \t]*void[ \t]int/d";
868 };
869
870
871 /*
872  *  Fix fcntl prototype in fcntl.h on LynxOS.
873  */
874 fix = {
875     hackname = lynxos_fcntl_proto;
876     files    = fcntl.h;
877     select   = 'fcntl.*\(int, int, int\)';
878     sed      = 's/\(fcntl.*(int, int, \)int)/\1...)/';
879 };
880
881
882 /*
883  *  libm.a on m88k-motorola-sysv3 contains a stupid optimization for
884  *  function hypot(), which returns the second argument without even
885  *  looking at its value, if the other is 0.0.  Another drawback is
886  *  that fix-header doesn't fix fabs' prototype, and I have no idea why.
887  */
888 fix = {
889     hackname = m88k_bad_hypot_opt;
890     mach     = "m88k-motorola-sysv3*";
891     files    = "math.h";
892
893     sed = "s/extern double floor(), ceil(), fmod(), fabs();/"
894             "extern double floor(), ceil(), fmod(), fabs _PARAMS((double));/";
895
896     sed = "/^extern double hypot();$/a\\\n"
897           "\\/* Workaround a stupid Motorola optimization if one\\\n"
898           "   of x or y is 0.0 and the other is negative!  *\\/\\\n"
899           "#ifdef __STDC__\\\n"
900           "static __inline__ double fake_hypot (double x, double y)\\\n"
901           "#else\\\n"
902           "static __inline__ double fake_hypot (x, y)\\\n"
903           "\tdouble x, y;\\\n"
904           "#endif\\\n"
905           "{\\\n"
906           "\treturn fabs (hypot (x, y));\\\n"
907           "}\\\n"
908           "#define hypot\tfake_hypot\n";
909 };
910
911
912 /*
913  *  Fix incorrect S_IF* definitions on m88k-sysv3.
914  */
915 fix = {
916     hackname = m88k_bad_s_if;
917     mach     = "m88k-*-sysv3*";
918     files    = sys/stat.h;
919     select   = "#define[ \t]+S_IS[A-Z]*(m)[ \t]";
920
921     sed = "s/^\\(#define[ \t]*S_IS[A-Z]*(m)\\)[ \t]*"
922             "(m[ \t]*&[ \t]*\\(S_IF[A-Z][A-Z][A-Z][A-Z]*\\)[ \t]*)/"
923             "\\1 (((m)\\&S_IFMT)==\\2)/";
924
925     sed = "s/^\\(#define[ \t]*S_IS[A-Z]*(m)\\)[ \t]*"
926             "(m[ \t]*&[ \t]*\\(0[0-9]*\\)[ \t]*)/"
927             "\\1 (((m)\\&S_IFMT)==\\2)/";
928 };
929
930
931 /*
932  * Put cpp wrappers around these include files to avoid redeclaration
933  * errors during multiple inclusion on m88k-tektronix-sysv3.
934  */
935 fix = {
936     hackname = m88k_multi_incl;
937     mach     = "m88k-tektronix-sysv3*";
938     files    = "time.h";
939     bypass   = "#ifndef";
940     shell    =
941       "echo Fixing $file, to protect against multiple inclusion. >&2
942       cpp_wrapper=`echo $file | sed -e 's,\\.,_,g' -e 's,/,_,g'`
943       echo \"#ifndef __GCC_GOT_${cpp_wrapper}_\"
944       echo \"#define __GCC_GOT_${cpp_wrapper}_\"
945       cat
946       echo \"#endif /* ! __GCC_GOT_${cpp_wrapper}_ */\"";
947 };
948
949
950 /*
951  *  Fix non-ansi machine name defines
952  *  File selection is split into two parts:  the shell version as
953  *  a single patch, and the program version with each patch separate.
954  *  Each is substantially faster for the particular environment.
955  *  You have a dual maintenance problem here.
956  */
957 fix = {
958     hackname = machine_name;
959     /*
960      *  Select '#if.*' and '#elif" with possible non-ansi symbols
961      *  The only non-ansi symbols we know about start with one of:
962      *     MRS_bhimnprstuv
963      *  If any are added to the substitution list, then add it to
964      *  the selection list as well.  Hopefully we can avoid names
965      *  starting with "d" and "l", because this pattern would then
966      *  match "defined" and "lint" as well.  I suppose we could add
967      *  a "bypass = lint" if we had to though.
968      *
969      * The fixinc_eol stuff is to work around a bug in the sed
970      */
971     select = "^#[ \t]*(if|elif).*"
972              "[^a-zA-Z0-9_](_*[MSRrhim]|[Mbimnpstuv])[a-zA-Z0-9_]";
973     exesel = "^#[ \t]*(if|elif).*[^a-zA-Z0-9_]"
974              "("
975                   "M32"
976                  "|_*MIPSE[LB]"
977                  "|_*SYSTYPE_[A-Z0-9]"
978                  "|_*[Rr][34]000"
979                  "|_*host_mips"
980                  "|_*i386"
981                  "|_*mips"
982                  "|bsd4"
983                  "|is68k"
984                  "|m[68]8k"
985                  "|mc680"
986                  "|news"
987                  "|ns32000"
988                  "|pdp11"
989                  "|pyr"
990                  "|sel"
991                  "|sony_news"
992                  "|sparc"
993                  "|sun"
994                  "|tahoe"
995                  "|tower"
996                  "|u370"
997                  "|u3b"
998                  "|unix"
999                  "|vax"
1000              ")";
1001
1002     sed =      ":loop\n"
1003                '/\\\\$/'                       "N\n"
1004                's/\\\\$/\\\\+++fixinc_eol+++/' "\n"
1005                '/\\\\$/'                       "b loop\n"
1006                's/\\\\+++fixinc_eol+++/\\\\/g' "\n"
1007
1008           "/#[\t ]*[el]*if/ {\n"
1009                 "\ts/[a-zA-Z0-9_][a-zA-Z0-9_]*/ & /g\n"
1010
1011                 "\ts/ M32 / __M32__ /g\n"
1012                 "\ts/ _*MIPSE\\([LB]\\) / __MIPSE\\1__ /g\n"
1013                 "\ts/ _*SYSTYPE_\\([A-Z0-9]*\\) / __SYSTYPE_\\1__ /g\n"
1014                 "\ts/ _*\\([Rr][34]\\)000 / __\\1000__ /g\n"
1015                 "\ts/ _*host_mips / __host_mips__ /g\n"
1016                 "\ts/ _*i386 / __i386__ /g\n"
1017                 "\ts/ _*mips / __mips__ /g\n"
1018                 "\ts/ bsd4\\([0-9]\\) / __bsd4\\1__ /g\n"
1019                 "\ts/ is68k / __is68k__ /g\n"
1020                 "\ts/ m68k / __m68k__ /g\n"
1021                 "\ts/ m88k / __m88k__ /g\n"
1022                 "\ts/ mc680\\([0-9]\\)0 / __mc680\\10__ /g\n"
1023                 "\ts/ news\\([0-9]*\\) / __news\\1__ /g\n"
1024                 "\ts/ ns32000 / __ns32000__ /g\n"
1025                 "\ts/ pdp11 / __pdp11__ /g\n"
1026                 "\ts/ pyr / __pyr__ /g\n"
1027                 "\ts/ sel / __sel__ /g\n"
1028                 "\ts/ sony_news / __sony_news__ /g\n"
1029                 "\ts/ sparc / __sparc__ /g\n"
1030                 "\ts/ sun\\([a-z0-9]*\\) / __sun\\1__ /g\n"
1031                 "\ts/ tahoe / __tahoe__ /g\n"
1032                 "\ts/ tower\\([_0-9]*\\) / __tower\\1__ /g\n"
1033                 "\ts/ u370 / __u370__ /g\n"
1034                 "\ts/ u3b\\([0-9]*\\) / __u3b\\1__ /g\n"
1035                 "\ts/ unix / __unix__ /g\n"
1036                 "\ts/ vax / __vax__ /g\n"
1037
1038                 "\ts/ \\([a-zA-Z0-9_][a-zA-Z0-9_]*\\) /\\1/g\n\t}";
1039 };
1040
1041
1042 /*
1043  *  Some math.h files define struct exception, which conflicts with
1044  *  the class exception defined in the C++ file std/stdexcept.h.  We
1045  *  redefine it to __math_exception.  This is not a great fix, but I
1046  *  haven't been able to think of anything better.
1047  */
1048 fix = {
1049     hackname = math_exception;
1050     files    = math.h;
1051     select   = "struct exception";
1052     sed      = "/struct exception/i\\\n"
1053                "#ifdef __cplusplus\\\n"
1054                "#define exception __math_exception\\\n"
1055                "#endif\n";
1056     sed      = "/struct exception/a\\\n"
1057                "#ifdef __cplusplus\\\n"
1058                "#undef exception\\\n"
1059                "#endif\n";
1060
1061     sed      = "/matherr/i\\\n"
1062                "#ifdef __cplusplus\\\n"
1063                "#define exception __math_exception\\\n"
1064                "#endif\n";
1065
1066     sed      = "/matherr/a\\\n"
1067                "#ifdef __cplusplus\\\n"
1068                "#undef exception\\\n"
1069                "#endif\n";
1070
1071 #ifdef MATH_EXCEPTION_FIXED
1072
1073 I think this patch needs some more thinking.
1074 This is from SVR4.2 (With '#' replaced with '@').
1075 Perhaps we could do without the "/matherr/a" entries?
1076 Can we bypass the entire fix if someone was astute
1077 enough to have '#ifdef __cplusplus' anywhere in the file?
1078
1079
1080 *** /usr/include/math.h Fri Apr  3 18:54:59 1998
1081 --- math.h      Sun May  9 07:28:58 1999
1082 ***************
1083 *** 25,31 ****
1084 --- 25,37 ----
1085   
1086   @ifndef __cplusplus
1087   
1088 + @ifdef __cplusplus
1089 + @define exception __math_exception
1090 + @endif
1091   struct exception
1092 + @ifdef __cplusplus
1093 + @undef exception
1094 + @endif
1095   {
1096         int     type;
1097         char    *name;
1098 ***************
1099 *** 34,40 ****
1100 --- 40,58 ----
1101         double  retval;
1102   };
1103   
1104 + @ifdef __cplusplus
1105 + @define exception __math_exception
1106 + @endif
1107 + @ifdef __cplusplus
1108 + @define exception __math_exception
1109 + @endif
1110   extern int    matherr(struct exception *);
1111 + @ifdef __cplusplus
1112 + @undef exception
1113 + @endif
1114 + @ifdef __cplusplus
1115 + @undef exception
1116 + @endif
1117   
1118   @endif /*__cplusplus*/
1119 #endif
1120 };
1121
1122
1123 /*
1124  * In math.h, put #ifndefs around things that might be defined
1125  * in a gcc specific math-*.h file.
1126  */
1127 fix = {
1128     hackname = math_gcc_ifndefs;
1129     files    = math.h;
1130
1131     shell    =
1132     /*
1133      *  First see if we have a definition for DBL_MAX in float.h
1134      *  If we do, we will replace the one in math.h with that one.
1135      */
1136
1137     /*
1138      *  IF we have such a define *and* HUGE_VAL is defined to be DBL_MAX
1139      *     *and* DBL_MAX is _not_ defined in the current file (math.h),
1140      *  THEN replace the defined value of HUGE_VAL
1141      *  ELSE just copy stdin to stdout so the main filter can process it
1142      */
1143
1144     /*
1145      *  Put conditional guards around the HUGE_VAL definition.
1146      */
1147
1148     "\tdbl_max_def=`egrep 'define[ \t]+DBL_MAX[ \t]+.*' float.h "
1149                 "2>/dev/null`\n\n"
1150
1151     "\tif ( test -n \"${dbl_max_def}\" \\\n"
1152     "\t\t-a -n \"`egrep '#define[ \t]*HUGE_VAL[ \t]+DBL_MAX' $file`\" \\\n"
1153     "\t\t-a -z \"`egrep '#define[ \t]+DBL_MAX[ \t]+' $file`\"\n"
1154              "\t   ) > /dev/null 2>&1\n"
1155     "\tthen sed -e '/define[ \t]HUGE_VAL[ \t]DBL_MAX/s/DBL_MAX/$dbl_max_def/'"
1156     "\n\telse cat ; fi |\n"
1157
1158     "\tsed -e '/define[ \t]HUGE_VAL[ \t]/i\\\n#ifndef HUGE_VAL\n' "
1159           "-e '/define[ \t]HUGE_VAL[ \t]/a\\\n#endif\n'";
1160 };
1161
1162
1163 /*
1164  *  nested comment
1165  */
1166 fix = {
1167     hackname = nested_comment;
1168     files    = rpc/rpc.h;
1169     sed      = 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@';
1170 };
1171
1172
1173 /*
1174  *  fix bogus recursive stdlib.h in NEWS-OS 4.0C
1175  */
1176 fix = {
1177     hackname = news_os_recursion;
1178     files    = stdlib.h;
1179     select   = "#include <stdlib.h>";
1180     sed      = "/^#include <stdlib.h>/i\\\n"
1181                     "#ifdef BOGUS_RECURSION\n";
1182     sed      = "/^#include <stdlib.h>/a\\\n"
1183                     "#endif\n";
1184 };
1185
1186
1187 /*
1188  *  NeXT 3.2 adds const prefix to some math functions.
1189  *  These conflict with the built-in functions.
1190  */
1191 fix = {
1192     hackname = next_math_prefix;
1193     files    = ansi/math.h;
1194     select   = "^extern.*double.*__const__.*";
1195
1196     sed = "/^extern.*double.*__const__.*sqrt(/s/__const__//";
1197     sed = "/^extern.*double.*__const__.*fabs(/s/__const__//";
1198     sed = "/^extern.*double.*__const__.*cos(/s/__const__//";
1199     sed = "/^extern.*double.*__const__.*hypot(/s/__const__//";
1200     sed = "/^extern.*double.*__const__.*sin(/s/__const__//";
1201 };
1202
1203
1204 /*
1205  *  NeXT 3.2 uses the word "template" as a parameter for some
1206  *  functions. GCC reports an invalid use of a reserved key word
1207  *  with the built-in functions. NeXT 3.2 includes the keyword
1208  *  volatile in the prototype for abort(). This conflicts with
1209  *  the built-in definition.
1210  */
1211 fix = {
1212     hackname = next_template;
1213     files    = bsd/libc.h;
1214     select   = template;
1215
1216     sed = '/\(.*template\)/s/template//';
1217     sed = "/extern.*volatile.*void.*abort/s/volatile//";
1218 };
1219
1220
1221 /*
1222  *  NeXT 3.2 includes the keyword volatile in the abort() and  exit()
1223  *  function prototypes. That conflicts with the  built-in functions.
1224  */
1225 fix = {
1226     hackname = next_volitile;
1227     files    = ansi/stdlib.h;
1228     select   = volatile;
1229
1230     sed    = "/extern.*volatile.*void.*exit/s/volatile//";
1231     sed    = "/extern.*volatile.*void.*abort/s/volatile//";
1232 };
1233
1234
1235 /*
1236  *  NeXT 2.0 defines 'int wait(union wait*)', which conflicts with Posix.1.
1237  *  Note that version 3 of the NeXT system has wait.h in a different directory,
1238  *  so that this code won't do anything.  But wait.h in version 3 has a
1239  *  conditional, so it doesn't need this fix.  So everything is okay.
1240  */
1241 fix = {
1242     hackname = next_wait_union;
1243     files    = sys/wait.h;
1244
1245     select = 'wait\(union wait';
1246
1247     sed = "s@wait(union wait@wait(void@";
1248 };
1249
1250
1251 /*
1252  *  a missing semi-colon at the end of the nodeent structure definition.
1253  */
1254 fix = {
1255     hackname = nodeent_syntax;
1256     files    = netdnet/dnetdb.h;
1257     sed      = "s/char.*na_addr *$/char *na_addr;/";
1258 };
1259
1260
1261 /*
1262  *  sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by
1263  *  defining regex.h related types.  This causes libg++ build and usage
1264  *  failures.  Fixing this correctly requires checking and modifying 3 files.
1265  */
1266 fix = {
1267     hackname = osf_namespace_a;
1268     files    = reg_types.h;
1269     files    = sys/lc_core.h;
1270     test     = " -r reg_types.h";
1271     test     = " -r sys/lc_core.h";
1272     test     = " -n \"`grep '} regex_t;' reg_types.h`\"";
1273     test     = " -z \"`grep __regex_t regex.h`\"";
1274
1275     sed      = "s/regex_t/__regex_t/g";
1276     sed      = "s/regoff_t/__regoff_t/g";
1277     sed      = "s/regmatch_t/__regmatch_t/g";
1278 };
1279
1280 fix = {
1281     hackname = osf_namespace_b;
1282     files    = regex.h;
1283     test     = " -r reg_types.h";
1284     test     = " -r sys/lc_core.h";
1285     test     = " -n \"`grep '} regex_t;' reg_types.h`\"";
1286     test     = " -z \"`grep __regex_t regex.h`\"";
1287
1288     sed      = "/#include <reg_types.h>/a\\\n"
1289                "typedef __regex_t\tregex_t;\\\n"
1290                "typedef __regoff_t\tregoff_t;\\\n"
1291                "typedef __regmatch_t\tregmatch_t;\n";
1292 };
1293
1294
1295 /*
1296  *  Fix __page_size* declarations in pthread.h AIX 4.1.[34].
1297  *  The original ones fail if uninitialized externs are not common.
1298  *  This is the default for all ANSI standard C++ compilers.
1299  */
1300 fix = {
1301     hackname = pthread_page_size;
1302     files    = pthread.h;
1303     select   = "^int __page_size";
1304     sed      = "s/^int __page_size/extern int __page_size/";
1305 };
1306
1307
1308 /*
1309  *  Fix return type of fread and fwrite on sysV68
1310  */
1311 fix = {
1312     hackname = read_ret_type;
1313     files    = stdio.h;
1314     select   = "extern int\t.*, fread\\(\\), fwrite\\(\\)";
1315     sed      = "s/^\\(extern int\tfclose(), fflush()\\), "
1316                  "\\(fread(), fwrite()\\)\\(.*\\)$"
1317                "/extern unsigned int\t\\2;\\\n\\1\\3/";
1318 };
1319
1320
1321 /*
1322  *  function class(double x) conflicts with C++ keyword on rs/6000 
1323  */
1324 fix = {
1325     hackname = rs6000_double;
1326     files    = math.h;
1327     select   = '[^a-zA-Z_]class\(';
1328     
1329     sed   = "/class[(]/i\\\n#ifndef __cplusplus\n";
1330     sed   = "/class[(]/a\\\n#endif\n";
1331 };
1332
1333
1334 /*
1335  *  Wrong fchmod prototype on RS/6000.
1336  */
1337 fix = {
1338     hackname = rs6000_fchmod;
1339     files    = sys/stat.h;
1340     select   = 'fchmod\(char';
1341     sed      = 's/fchmod(char \*/fchmod(int/';
1342 };
1343
1344
1345 /*
1346  *  parameters conflict with C++ new on rs/6000 
1347  */
1348 fix = {
1349     hackname = rs6000_param;
1350     files  = "stdio.h";
1351     files  = "unistd.h";
1352
1353     sed = 's@rename(const char \*old, const char \*new)@'
1354             'rename(const char *_old, const char *_new)@';
1355 };
1356
1357
1358 /*
1359  *  Sony NEWSOS 5.0 does not support the complete ANSI C standard.
1360  */
1361 #ifdef SONY
1362 fix = {
1363     hackname = sony_ctype;
1364     files    = ctype.h;
1365     test     = " -x /bin/sony";
1366     test     = " ! -z \"`if /bin/sony ; then echo true ; fi`\"";
1367     sed      = "s/__ctype/_ctype/g";
1368 };
1369 #endif
1370
1371 /*
1372  *  Incorrect #include in Sony News-OS 3.2.
1373  */
1374 fix = {
1375     hackname = sony_include;
1376     files    = machine/machparam.h;
1377     select   = '"\.\./machine/endian.h"';
1378     sed      = 's@"../machine/endian.h"@<machine/endian.h>@';
1379 };
1380
1381
1382 /*
1383  *  Sony NEWSOS 5.0 does not support the complete ANSI C standard.
1384  */
1385 #ifdef SONY
1386 fix = {
1387     hackname = sony_stdio;
1388     files    = stdio.h;
1389     test     = " -x /bin/sony";
1390     test     = " ! -z \"`if /bin/sony ; then echo true ; fi`\"";
1391     sed      = "s/__filbuf/_filbuf/g\n"
1392                "s/__flsbuf/_flsbuf/g\n"
1393                "s/__iob/_iob/g";
1394 };
1395 #endif
1396
1397 /*
1398  *  Add a `static' declaration of `getrnge' into <regexp.h>.
1399  *
1400  *  Don't do this if there is already a `static void getrnge' declaration
1401  *  present, since this would cause a redeclaration error.  Solaris 2.x has
1402  *  such a declaration.
1403  */
1404 #ifdef SVR4
1405 fix = {
1406     hackname = static_getrnge;
1407     files    = regexp.h;
1408     bypass   = "static void getrnge";
1409     sed      = "/^static int[ \t]*size;/c\\\n"
1410                "static int      size ;\\\n\\\n"
1411                "static int getrnge ();";
1412 };
1413 #endif
1414
1415 /*
1416  *  a missing semi-colon at the end of the statsswtch structure definition.
1417  */
1418 fix = {
1419     hackname = statsswtch;
1420     files    = rpcsvc/rstat.h;
1421     select   = "boottime$";
1422     sed      = "s/boottime$/boottime;/";
1423 };
1424
1425
1426 /*
1427  *  Don't use or define the name va_list in stdio.h.
1428  *  This is for ANSI and also to interoperate properly with gcc's varargs.h.
1429  *  Arrange for stdio.h to use stdarg.h to define __gnuc_va_list
1430  */
1431 fix = {
1432     hackname = stdio_va_list;
1433     files    = stdio.h;
1434
1435     /*
1436      * Use __gnuc_va_list in arg types in place of va_list.
1437      * On 386BSD use __gnuc_va_list instead of _VA_LIST_.  We're hoping the
1438      * trailing parentheses and semicolon save all other systems from this.
1439      * Define __va_list__ (something harmless and unused) instead of va_list.
1440      * Don't claim to have defined va_list.
1441      */
1442     shell =
1443  "if ( egrep \"__need___va_list\" $file ) > /dev/null 2>&1 ; then
1444     :
1445   else
1446     echo \"#define __need___va_list\"
1447     echo \"#include <stdarg.h>\"
1448   fi
1449
1450   sed -e 's@ va_list @ __gnuc_va_list @' \\
1451       -e 's@ va_list)@ __gnuc_va_list)@' \\
1452       -e 's@ _BSD_VA_LIST_))@ __gnuc_va_list))@' \\
1453       -e 's@ _VA_LIST_));@ __gnuc_va_list));@' \\
1454       -e 's@ va_list@ __va_list__@' \\
1455       -e 's@\\*va_list@*__va_list__@' \\
1456       -e 's@ __va_list)@ __gnuc_va_list)@' \\
1457       -e 's@GNUC_VA_LIST@GNUC_Va_LIST@' \\
1458       -e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \\
1459       -e 's@VA_LIST@DUMMY_VA_LIST@' \\
1460       -e 's@_Va_LIST@_VA_LIST@'";
1461 };
1462
1463
1464 /*
1465  *  Check for strict ansi compliance
1466  */
1467 #ifdef STRICT_ANSI
1468 fix = {
1469     hackname = strict_ansi;
1470     select   = "__STDC__[ \t]*[=!]=[ \t]*[01]";
1471     sed      = "s/__STDC__[ \t]*==[ \t]*0/!defined (__STRICT_ANSI__)/g";
1472     sed      = "s/__STDC__[ \t]*!=[ \t]*0/defined (__STRICT_ANSI__)/g";
1473     sed      = "s/__STDC__[ \t]*==[ \t]*1/defined (__STRICT_ANSI__)/g";
1474     sed      = "s/__STDC__[ \t]*!=[ \t]*1/!defined (__STRICT_ANSI__)/g";
1475 };
1476 #endif
1477
1478 /*
1479  *  Fix bogus #ifdef on SunOS 4.1.
1480  */
1481 fix = {
1482     hackname = sun_bogus_ifdef;
1483     files  = "hsfs/hsfs_spec.h";
1484     files  = "hsfs/iso_spec.h";
1485     select = '#ifdef __i386__ || __vax__';
1486     sed    = "s/\\#ifdef __i386__ || __vax__/\\#if __i386__ || __vax__/g";
1487 };
1488
1489
1490 /*
1491  *  Fix bogus #ifdef on SunOS 4.1.
1492  */
1493 fix = {
1494     hackname = sun_bogus_ifdef_sun4c;
1495     files  = "hsfs/hsnode.h";
1496     select = '#ifdef __i386__ || __sun4c__';
1497     sed    = "s/\\#ifdef __i386__ || __sun4c__/\\#if __i386__ || __sun4c__/g";
1498 };
1499
1500
1501 /*
1502  *  Fix the CAT macro in SunOS memvar.h.
1503  */
1504 fix = {
1505     hackname = sun_catmacro;
1506     files  = pixrect/memvar.h;
1507     select = "^#define[ \t]+CAT\\(a,b\\)";
1508     sed    = "/^#define[ \t]CAT(a,b)/ i\\\n"
1509                  "#ifdef __STDC__ \\\n"
1510                  "#define CAT(a,b) a##b\\\n"
1511                  "#else\n";
1512
1513     sed    = "/^#define[ \t]CAT(a,b)/ a\\\n"
1514                  "#endif\n";
1515 };
1516
1517
1518 /*
1519  *  Fix return type of free and {c,m,re}alloc in <malloc.h> on SunOS 4.1.
1520  *  Also fix return type of {m,re}alloc in <malloc.h> on sysV68
1521  */
1522 fix = {
1523     hackname = sun_malloc;
1524     files    = malloc.h;
1525
1526     sed   = "s/typedef[ \t]char \\*\tmalloc_t/typedef void \\*\tmalloc_t/g";
1527     sed   = "s/int[ \t][ \t]*free/void\tfree/g";
1528     sed   = "s/char\\([ \t]*\\*[ \t]*malloc\\)/void\\1/g";
1529     sed   = "s/char\\([ \t]*\\*[ \t]*realloc\\)/void\\1/g";
1530 };
1531
1532
1533 /*
1534  *  Fix non-ANSI memcpy declaration that conflicts with gcc's builtin
1535  *  declaration on Sun OS 4.x.  We must only fix this on Sun OS 4.x, because
1536  *  many other systems have similar text but correct versions of the file.
1537  *  To ensure only Sun's is fixed, we grep for a likely unique string.
1538  *  Fix also on sysV68 R3V7.1 (head/memory.h\t50.1\t )
1539  */
1540 fix = {
1541     hackname = sun_memcpy;
1542     files    = memory.h;
1543     select = "/\\*\t@\\(#\\)"
1544              "(head/memory.h\t50.1\t "
1545              "|memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2\t)\\*/";
1546
1547     sed    = "1i\\\n/* This file was generated by fixincludes */\\\n"
1548              "#ifndef __memory_h__\\\n"
1549              "#define __memory_h__\\\n\\\n"
1550              "#ifdef __STDC__\\\n"
1551              "extern void *memccpy();\\\n"
1552              "extern void *memchr();\\\n"
1553              "extern void *memcpy();\\\n"
1554              "extern void *memset();\\\n"
1555              "#else\\\n"
1556              "extern char *memccpy();\\\n"
1557              "extern char *memchr();\\\n"
1558              "extern char *memcpy();\\\n"
1559              "extern char *memset();\\\n"
1560              "#endif /* __STDC__ */\\\n\\\n"
1561              "extern int memcmp();\\\n\\\n"
1562              "#endif /* __memory_h__ */\n";
1563
1564     sed    = "1,$d";
1565 };
1566
1567
1568 /*
1569  *  Check for yet more missing ';' in struct (in SunOS 4.0.x)
1570  */
1571 fix = {
1572     hackname = sun_rusers_semi;
1573     files    = rpcsvc/rusers.h;
1574     select   = "_cnt$";
1575     sed      = "/^struct/,/^};/s/_cnt$/_cnt;/";
1576 };
1577
1578
1579 /*
1580  *  signal.h on SunOS defines signal using (),
1581  *  which causes trouble when compiling with g++ -pedantic.
1582  */
1583 fix = {
1584     hackname = sun_signal;
1585     files    = sys/signal.h;
1586     files    = signal.h;
1587     select   = "^void\t" '\(\*signal\(\)\)\(\);';
1588
1589     sed = "/^void\t" '(\*signal())();$/i'  "\\\n"
1590           "#ifdef __cplusplus"             "\\\n"
1591           "void\t(*signal(...))(...);"     "\\\n"
1592           "#else"                          "\n";
1593
1594     sed = "/^void\t" '(\*signal())();$/a'  "\\\n"
1595           '#endif'                         "\n";
1596 };
1597
1598
1599 /*
1600  *  Apply fix this to all OSs since this problem seems to effect
1601  *  more than just SunOS.  In general, fixes which are triggered
1602  *  by a specific target are bad.
1603  */
1604 fix = {
1605     hackname = sun_auth_proto;
1606     files    = rpc/auth.h;
1607     files    = rpc/clnt.h;
1608     files    = rpc/svc.h;
1609     files    = rpc/xdr.h;
1610     /*
1611      *  Select those files containing '(*name)()'.
1612      */
1613     select   = '\(\*[a-z][a-z_]*\)\(\)';
1614     sed      = 's'
1615                 '/^\(.*(\*[a-z][a-z_]*)(\)'      '\();.*\)'
1616                 "/\\\n"
1617                     "#ifdef __cplusplus\\\n"
1618                     '\1...\2' "\\\n"
1619                     "#else\\\n"
1620                     '\1\2' "\\\n"
1621                     "#endif"
1622                 "/";
1623 };
1624
1625
1626 /*
1627  *  math.h on SunOS 4 puts the declaration of matherr before the definition
1628  *  of struct exception, so the prototype (added by fixproto) causes havoc.
1629  */
1630 fix = {
1631     hackname = sunos_matherr_decl;
1632     files    = math.h;
1633     /*
1634      *  Once a declaration for 'struct exception' is found,
1635      *  stop trying to insert a forward reference for it.
1636      */
1637     sed = "/^struct exception/,$b";
1638     sed = "/matherr/i\\\nstruct exception;\n";
1639 };
1640
1641
1642 /*
1643  *  Correct the return type for strlen in strings.h in SunOS 4.
1644  */
1645 fix = {
1646     hackname = sunos_strlen;
1647     files    = strings.h;
1648     sed = "s/int[ \t]*strlen();/__SIZE_TYPE__ strlen();/";
1649 };
1650
1651
1652 /*
1653  *  Solaris math.h and floatingpoint.h define __P without protection,
1654  *  which conflicts with the fixproto definition.  The fixproto
1655  *  definition and the Solaris definition are used the same way.
1656  */
1657 #ifdef SVR4
1658 fix = {
1659     hackname = svr4__p;
1660     files    = math.h;
1661     files    = floatingpoint.h;
1662     select   = "^#define[ \t]*__P";
1663     sed      = "/^#define[ \t]*__P/i\\\n#ifndef __P\n";
1664     sed      = "/^#define[ \t]*__P/a\\\n#endif\n";
1665 };
1666 #endif
1667
1668 /*
1669  *  Disable apparent native compiler optimization cruft in SVR4.2 <string.h>
1670  *  that is visible to any ANSI compiler using this include.  Simply
1671  *  delete the lines that #define some string functions to internal forms.
1672  */
1673 #ifdef SVR4
1674 fix = {
1675     hackname = svr4_disable_opt;
1676     files    = string.h;
1677     select   = '#define.*__std_hdr_';
1678     sed      = '/#define.*__std_hdr_/d';
1679 };
1680 #endif
1681
1682 /*
1683  *  Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__.
1684  */
1685 #ifdef SVR4
1686 fix = {
1687     hackname = svr4_endian;
1688     files    = sys/endian.h;
1689     bypass   = '__GNUC__';
1690
1691     sed      = "/#\tifdef\t__STDC__/i\\\n"
1692                "#   if !defined (__GNUC__) && !defined (__GNUG__)\n";
1693
1694     sed      = "/#\t\tinclude\t<sys\\/byteorder.h>/s/\t\t/   /";
1695
1696     sed      = "/#   include\t<sys\\/byteorder.h>/i\\\n"
1697                "#   endif /* !defined (__GNUC__) && !defined (__GNUG__) */\n";
1698 };
1699 #endif
1700
1701 /*
1702  *  Remove useless extern keyword from struct forward declarations
1703  *  in <sys/stream.h> and <sys/strsubr.h>
1704  */
1705 #ifdef SVR4
1706 fix = {
1707     hackname = svr4_extern_struct;
1708     files    = sys/stream.h;
1709     files    = sys/strsubr.h;
1710     select   = 'extern struct [a-z_]*;';
1711     sed      = 's/extern struct \([a-z][a-z_]*\)/struct \1/';
1712 };
1713 #endif
1714
1715 /*
1716  *  Fix declarations of `ftw' and `nftw' in <ftw.h>.  On some/most SVR4
1717  *  systems the file <ftw.h> contains extern declarations of these
1718  *  functions followed by explicitly `static' definitions of these
1719  *  functions... and that's not allowed according to ANSI C.  (Note
1720  *  however that on Solaris, this header file glitch has been pre-fixed by
1721  *  Sun.  In the Solaris version of <ftw.h> there are no static
1722  *  definitions of any function so we don't need to do any of this stuff
1723  *  when on Solaris.
1724  */
1725 #ifdef SVR4
1726 #ifndef SOLARIS
1727 fix = {
1728     hackname = svr4_ftw;
1729     files    = ftw.h;
1730     select   = '^extern int ftw\(const';
1731
1732     sed = '/^extern int ftw(const/i' "\\\n"
1733             "#if !defined(_STYPES)\\\n"
1734             "static\\\n"
1735             "#else\\\n"
1736             "extern\\\n"
1737             "#endif";
1738     sed = 's/extern \(int ftw(const.*\)$/\1/';
1739     sed = "/^extern int nftw/i\\\n"
1740             "#if defined(_STYPES)\\\n"
1741             "static\\\n"
1742             "#else\\\n"
1743             "extern\\\n"
1744             "#endif";
1745     sed = 's/extern \(int nftw.*\)$/\1/';
1746     sed = "/^extern int ftw(),/c\\\n"
1747             "#if !defined(_STYPES)\\\n"
1748             "static\\\n"
1749             "#else\\\n"
1750             "extern\\\n"
1751             "#endif\\\n"
1752             "  int ftw();\\\n"
1753             "#if defined(_STYPES)\\\n"
1754             "static\\\n"
1755             "#else\\\n"
1756             "extern\\\n"
1757             "#endif\\\n"
1758             "  int nftw();";
1759 };
1760 #endif
1761 #endif
1762
1763
1764 /*
1765  *   Fix broken decl of getcwd present on some svr4 systems.
1766  */
1767 #ifdef SVR4
1768 fix = {
1769     hackname = svr4_getcwd;
1770     files    = stdlib.h;
1771     files    = unistd.h;
1772     select   = 'getcwd\(char \*, int\)';
1773
1774     sed = 's/getcwd(char \*, int)/getcwd(char *, size_t)/';
1775 };
1776 #endif
1777
1778 /*
1779  *  set ifdef _KERNEL
1780  */
1781 #ifdef SVR4
1782 fix = {
1783     hackname = svr4_kernel;
1784     files    = fs/rfs/rf_cache.h;
1785     files    = sys/erec.h;
1786     files    = sys/err.h;
1787     files    = sys/char.h;
1788     files    = sys/getpages.h;
1789     files    = sys/map.h;
1790     files    = sys/cmn_err.h;
1791     files    = sys/kdebugger.h;
1792     bypass   = '_KERNEL';
1793     sed      = "1i\\\n#ifdef _KERNEL";
1794     sed      = "$a\\\n#endif /* _KERNEL */";
1795 };
1796 #endif
1797
1798 /*
1799  *  Delete any #defines of `__i386' which may be present in <ieeefp.h>.  They
1800  *  tend to conflict with the compiler's own definition of this symbol.  (We
1801  *  will use the compiler's definition.)
1802  *  Likewise __sparc, for Solaris, and __i860, and a few others
1803  *  (guessing it is necessary for all of them).
1804  */
1805 #ifdef SVR4
1806 fix = {
1807     hackname = svr4_mach_defines;
1808     files    = ieeefp.h;
1809     select   = "#define[ \t]*__(i386|i860|mips|sparc|m88k|m68k)[ \t]";
1810     sed      = "/#define[ \t]*__\\(i386|i860|mips|sparc|m88k|m68k\\)[ \t]/d";
1811 };
1812 #endif
1813
1814 /*
1815  *  Fix declarations of `makedev', `major', and `minor' in <sys/mkdev.h>.
1816  */
1817 #ifdef SVR4
1818 fix = {
1819     hackname = svr4_mkdev;
1820     files    = sys/mkdev.h;
1821
1822     sed      = "/^dev_t makedev(const/c\\\n"
1823                "static dev_t makedev(const major_t, const minor_t);";
1824
1825     sed      = "/^dev_t makedev()/c\\\n"
1826                "static dev_t makedev();";
1827
1828     sed      = "/^major_t major(const/c\\\n"
1829                "static major_t major(const dev_t);";
1830
1831     sed      = "/^major_t major()/c\\\n"
1832                "static major_t major();";
1833
1834     sed      = "/^minor_t minor(const/c\\\n"
1835                "static minor_t minor(const dev_t);";
1836
1837     sed      = "/^minor_t minor()/c\\\n"
1838                "static minor_t minor();";
1839 };
1840 #endif
1841
1842 /*
1843  *  Fix reference to NC_NPI_RAW in <sys/netcspace.h>.
1844  *  Also fix types of array initializers.
1845  */
1846 #ifdef SVR4
1847 fix = {
1848     hackname = svr4_netcspace;
1849     files    = sys/netcspace.h;
1850     select   = 'NC_NPI_RAW';
1851     sed      = 's/NC_NPI_RAW/NC_TPI_RAW/g';
1852     sed      = 's/NC_/(unsigned long) NC_/';
1853 };
1854 #endif
1855
1856 /*
1857  *  Fix reference to NMSZ in <sys/adv.h>.
1858  */
1859 #ifdef SVR4
1860 fix = {
1861     hackname = svr4_nmsz;
1862     files    = sys/adv.h;
1863     select   = '\[NMSZ\]';
1864     sed      = 's/\[NMSZ\]/\[RFS_NMSZ\]/g';
1865 };
1866 #endif
1867
1868 /*
1869  *  Completely replace <sys/varargs.h> with a file that includes gcc's
1870  *  stdarg.h or varargs.h files as appropriate.
1871  */
1872 #ifdef SVR4
1873 fix = {
1874     hackname = svr4_no_varargs;
1875     files    = sys/varargs.h;
1876     shell    = "cat > /dev/null\n"
1877                "cat << _EOF_\n"
1878                "/* This file was generated by fixincludes.  */\n"
1879                "#ifndef _SYS_VARARGS_H\n"
1880                "#define _SYS_VARARGS_H\n\n"
1881
1882                "#ifdef __STDC__\n"
1883                "#include <stdarg.h>\n"
1884                "#else\n"
1885                "#include <varargs.h>\n"
1886                "#endif\n\n"
1887
1888                "#endif  /* _SYS_VARARGS_H */\n"
1889                "_EOF_";
1890 };
1891 #endif
1892
1893 /*
1894  *   Fix broken decl of profil present on some svr4 systems.
1895  */
1896 #ifdef SVR4
1897 fix = {
1898     hackname = svr4_profil;
1899     files    = stdlib.h;
1900     files    = unistd.h;
1901
1902     sed = 's/profil(unsigned short \*, unsigned int, '
1903                          'unsigned int, unsigned int)'
1904            '/profil(unsigned short *, size_t, int, unsigned)/';
1905 };
1906 #endif
1907
1908 /*
1909  *  Convert functions to prototype form, and fix arg names in <sys/stat.h>.
1910  */
1911 #ifdef SVR4
1912 fix = {
1913     hackname = svr4_proto_form;
1914     files    = sys/stat.h;
1915     select   = 'const extern';
1916
1917     sed      = "/^stat([ \t]*[^c]/ {\nN\nN\n"
1918                    "s/(.*)\\n/( /\n"
1919                    "s/;\\n/, /\n"
1920                    "s/;$/)/\n"  "}";
1921
1922     sed      = "/^lstat([ \t]*[^c]/ {\nN\nN\n"
1923                    "s/(.*)\\n/( /\n"
1924                    "s/;\\n/, /\n"
1925                    "s/;$/)/\n"  "}";
1926
1927     sed      = "/^fstat([ \t]*[^i]/ {\nN\nN\n"
1928                    "s/(.*)\\n/( /\n"
1929                    "s/;\\n/, /\n"
1930                    "s/;$/)/\n"  "}";
1931
1932     sed      = "/^mknod([ \t]*[^c]/{\nN\nN\nN\n"
1933                    "s/(.*)\\n/( /\n"
1934                    "s/;\\n/, /g\n"
1935                    "s/;$/)/\n"  "}";
1936
1937     sed      = "1,$s/\\([^A-Za-z]\\)path\\([^A-Za-z]\\)/\\1__path\\2/g";
1938     sed      = "1,$s/\\([^A-Za-z]\\)buf\\([^A-Za-z]\\)/\\1__buf\\2/g";
1939     sed      = "1,$s/\\([^A-Za-z]\\)fd\\([^A-Za-z]\\)/\\1__fd\\2/g";
1940     sed      = "1,$s/ret\\([^u]\\)/__ret\\1/g";
1941     sed      = "1,$s/\\([^_]\\)mode\\([^_]\\)/\\1__mode\\2/g";
1942     sed      = "1,$s/\\([^_r]\\)dev\\([^_]\\)/\\1__dev\\2/g";
1943 };
1944 #endif
1945
1946 /*
1947  *  Add a prototyped declaration of mmap to <sys/mman.h>.
1948  */
1949 #ifdef SVR4
1950 fix = {
1951     hackname = svr4_proto_mmap;
1952     files    = sys/mman.h;
1953     select   = '^extern caddr_t mmap();$';
1954     sed = '/^extern caddr_t mmap();$/c' "\\\n"
1955           "#ifdef __STDC__\\\n"
1956           "extern caddr_t mmap (caddr_t, size_t, int, int, int, off_t);\\\n"
1957           "#else /* !defined(__STDC__) */\\\n"
1958           "extern caddr_t mmap ();\\\n"
1959           "#endif /* !defined(__STDC__) */\\\n";
1960 };
1961 #endif
1962
1963 /*
1964  *  Add a #define of _SIGACTION_ into <sys/signal.h>.
1965  */
1966 #ifdef SVR4
1967 fix = {
1968     hackname = svr4_sigaction;
1969     files    = sys/signal.h;
1970     sed      = "/^struct sigaction {/i\\\n"
1971                "#define _SIGACTION_";
1972     sed      = 's/(void *(\*)())/(void (*)(int))/';
1973 };
1974 #endif
1975
1976 /*
1977  *  Put storage class at start of decl, to avoid warning.
1978  */
1979 #ifdef SVR4
1980 fix = {
1981     hackname = svr4_storage_class;
1982     files    = rpc/types.h;
1983     select   = 'const extern';
1984     sed      = 's/const extern/extern const/g';
1985 };
1986 #endif
1987
1988 /*
1989  *  Fix return value of mem{ccpy,chr,cpy,set} and str{len,spn,cspn}
1990  *  in string.h on sysV68
1991  *  Correct the return type for strlen in string.h on Lynx.
1992  *  Correct the argument type for ffs in string.h on Alpha OSF/1 V2.0.
1993  *  Add missing const for strdup on OSF/1 V3.0.
1994  *  On sysV88 layout is slightly different.
1995  */
1996 fix = {
1997     hackname = systypes;
1998     files  = "sys/types.h";
1999     files  = "stdlib.h";
2000     files  = "sys/stdtypes.h";
2001     files  = "stddef.h";
2002     files  = "memory.h";
2003     files  = "unistd.h";
2004     select = "typedef[ \t]+[a-z_][ \ta-z_]*[ \t]"
2005              "(size|ptrdiff|wchar)_t";
2006
2007       sed  = "/^[ \t]*\\*[ \t]*typedef unsigned int size_t;/N";
2008
2009       sed  = "s/^\\([ \t]*\\*[ \t]*typedef unsigned int size_t;\\n"
2010                "[ \t]*\\*\\/\\)/\\1\\\n"
2011              "#ifndef __SIZE_TYPE__\\\n"
2012              "#define __SIZE_TYPE__ long unsigned int\\\n"
2013              "#endif\\\n"
2014              "typedef __SIZE_TYPE__ size_t;\\\n/";
2015
2016       sed  = "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]size_t/i\\\n"
2017                    "#ifndef __SIZE_TYPE__\\\n"
2018                    "#define __SIZE_TYPE__ long unsigned int\\\n"
2019                    "#endif\n";
2020
2021       sed  = "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]size_t/"
2022                "typedef __SIZE_TYPE__ size_t/";
2023
2024       sed  = "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]ptrdiff_t/i\\\n"
2025                    "#ifndef __PTRDIFF_TYPE__\\\n"
2026                    "#define __PTRDIFF_TYPE__ long int\\\n"
2027                    "#endif\n";
2028
2029       sed  = "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]ptrdiff_t/"
2030                "typedef __PTRDIFF_TYPE__ ptrdiff_t/";
2031
2032       sed  = "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]wchar_t/i\\\n"
2033                    "#ifndef __WCHAR_TYPE__\\\n"
2034                    "#define __WCHAR_TYPE__ int\\\n"
2035                    "#endif\\\n"
2036                    "#ifndef __cplusplus\n";
2037
2038       sed  = "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]wchar_t/a\\\n"
2039                    "#endif\n";
2040
2041       sed  = "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]wchar_t/"
2042                "typedef __WCHAR_TYPE__ wchar_t/";
2043 };
2044
2045
2046 /*
2047  *  Fix return type of exit and abort in <stdlib.h> on SunOS 4.1.
2048  *  Also wrap protection around size_t for m88k-sysv3 systems.
2049  *  We use a funny name to ensure it follows 'systypes' fix.
2050  */
2051 fix = {
2052     hackname = systypes_for_aix;
2053     files    = sys/types.h;
2054     select   = "typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t";
2055     bypass   = "_GCC_SIZE_T";
2056
2057     sed    = "/typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t/i\\\n"
2058                  "#ifndef _GCC_SIZE_T\\\n"
2059                  "#define _GCC_SIZE_T\n";
2060
2061     sed    = "/typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t/a\\\n"
2062                  "#endif\n";
2063 };
2064
2065
2066 /*
2067  *  if the #if says _cplusplus, not the double underscore __cplusplus
2068  *  that it should be
2069  */
2070 fix = {
2071     hackname = sysv68_string;
2072     files    = string.h;
2073
2074     sed = "s/extern[ \t]*int[ \t]*strlen();/extern unsigned int strlen();/";
2075     sed = "s/extern[ \t]*int[ \t]*ffs[ \t]*(long);/extern int ffs(int);/";
2076     sed = "s/strdup(char \\*s1);/strdup(const char *s1);/";
2077     sed = "/^extern char$/N";
2078     sed = "s/^extern char\\(\\n\t\\*memccpy(),\\)$/extern void\\1/";
2079     sed = "/^\tstrncmp(),$/N";
2080     sed = "s/^\\(\tstrncmp()\\),\\n\\(\tstrlen(),\\)$/\\1;\\\n"
2081           "extern unsigned int\\\n\\2/";
2082     sed = "/^extern int$/N";
2083     sed = "s/^extern int\\(\\n\tstrlen(),\\)/extern size_t\\1/";
2084 };
2085
2086
2087 /*
2088  *  Fix return type of exit and abort in <stdlib.h>
2089  *  Also wrap protection around size_t.
2090  */
2091 fix = {
2092     hackname = sysz_stdlib_for_sun;
2093     files    = stdlib.h;
2094
2095     sed   = "s/int\tabort/void\tabort/g";
2096     sed   = "s/int\tfree/void\tfree/g";
2097     sed   = "s/char[ \t]*\\*[ \t]*calloc/void \\*\tcalloc/g";
2098     sed   = "s/char[ \t]*\\*[ \t]*malloc/void \\*\tmalloc/g";
2099     sed   = "s/char[ \t]*\\*[ \t]*realloc/void \\*\trealloc/g";
2100     sed   = "s/char[ \t]*\\*[ \t]*bsearch/void \\*\tbsearch/g";
2101     sed   = "s/int[ \t][ \t]*exit/void\texit/g";
2102
2103     sed   = "/typedef[ \ta-zA-Z_]*[ \t]size_t[ \t]*;/i\\\n"
2104                 "#ifndef _GCC_SIZE_T\\\n"
2105                 "#define _GCC_SIZE_T\n";
2106
2107     sed   = "/typedef[ \ta-zA-Z_]*[ \t]size_t[ \t]*;/a\\\n"
2108                 "#endif\n";
2109 };
2110
2111
2112 /*
2113  *  Fix this Sun file to avoid interfering with stddef.h.
2114  *  We use a funny name to ensure it follows 'systypes' fix.
2115  */
2116 fix = {
2117     hackname = sysz_stdtypes_for_sun;
2118     files = sys/stdtypes.h;
2119     sed   = "/[\t ]size_t.*;/i\\\n"
2120               "#ifndef _GCC_SIZE_T\\\n"
2121               "#define _GCC_SIZE_T\n";
2122
2123     sed   = "/[\t ]size_t.*;/a\\\n"
2124               "#endif\n";
2125
2126     sed   = "/[\t ]ptrdiff_t.*;/i\\\n"
2127               "#ifndef _GCC_PTRDIFF_T\\\n"
2128               "#define _GCC_PTRDIFF_T\n";
2129
2130     sed   = "/[\t ]ptrdiff_t.*;/a\\\n"
2131               "#endif\n";
2132
2133     sed   = "/[\t ]wchar_t.*;/i\\\n"
2134               "#ifndef _GCC_WCHAR_T\\\n"
2135               "#define _GCC_WCHAR_T\n";
2136
2137     sed   = "/[\t ]wchar_t.*;/a\\\n"
2138               "#endif\n";
2139 };
2140
2141
2142 /*
2143  *  Fix this file to avoid interfering with stddef.h,
2144  *  but don't mistakenly match ssize_t present in AIX for the ps/2,
2145  *  or typedefs which use (but do not set) size_t.
2146  */
2147 fix = {
2148     hackname = tinfo_cplusplus;
2149     files    = tinfo.h;
2150     sed      = "s/[ \t]_cplusplus/ __cplusplus/";
2151 };
2152
2153
2154 /*
2155  *  Cancel out ansi_compat.h on Ultrix.  Replace it with empty file.
2156  */
2157 fix = {
2158     hackname = ultrix_ansi_compat;
2159     files    = ansi_compat.h;
2160     select   = ULTRIX;
2161     sed      = "1i\\\n/* This file intentionally left blank. */\n";
2162     sed      = "1,$d";
2163 };
2164
2165
2166 /*
2167  * Ultrix V4.[35] puts the declaration of uname before the definition
2168  * of struct utsname, so the prototype (added by fixproto) causes havoc.
2169  */
2170 fix = {
2171     hackname = ultrix_fix_fixproto;
2172     files    = sys/utsname.h;
2173     select   = ULTRIX;
2174     sed      = "/^[ \t]*extern[ \t]*int[ \t]*uname();$/i\\\n"
2175                "struct utsname;\n";
2176 };
2177
2178
2179 /*
2180  *  parameter to atof not const on DECstation Ultrix V4.0 and NEWS-OS 4.2R.
2181  *  also get rid of bogus inline definitions in HP-UX 8.0
2182  */
2183 fix = {
2184     hackname = ultrix_atof_param;
2185     files    = math.h;
2186
2187     sed = "s@atof(\\([ \t]*char[ \t]*\\*[^)]*\\))@atof(const \\1)@";
2188     sed = "s@inline int abs(int [a-z][a-z]*) {.*}@extern \"C\" int abs(int);@";
2189     sed = "s@inline double abs(double [a-z][a-z]*) {.*}@@";
2190     sed = "s@inline int sqr(int [a-z][a-z]*) {.*}@@";
2191     sed = "s@inline double sqr(double [a-z][a-z]*) {.*}@@";
2192 };
2193
2194
2195 /*
2196  *  parameters not const on DECstation Ultrix V4.0 and OSF/1.
2197  */
2198 fix = {
2199     hackname = ultrix_const;
2200     files    = stdio.h;
2201
2202     sed   = 's@perror( char \*__s );@perror( const char *__s );@';
2203     sed   = 's@fputs( char \*__s,@fputs( const char *__s,@';
2204     sed   = 's@fopen( char \*__filename, char \*__type );@'
2205               'fopen( const char *__filename, const char *__type );@';
2206     sed   = 's@fwrite( void \*__ptr,@fwrite( const void *__ptr,@';
2207     sed   = 's@fscanf( FILE \*__stream, char \*__format,@'
2208               'fscanf( FILE *__stream, const char *__format,@';
2209     sed   = 's@scanf( char \*__format,@scanf( const char *__format,@';
2210     sed   = 's@sscanf( char \*__s, char \*__format,@'
2211               'sscanf( const char *__s, const char *__format,@';
2212     sed   = 's@popen(char \*, char \*);@popen(const char *, const char *);@';
2213     sed   = 's@tempnam(char\*,char\*);@tempnam(const char*,const char*);@';
2214 };
2215
2216
2217 /*
2218  *  Check for bad #ifdef line (in Ultrix 4.1)
2219  */
2220 fix = {
2221     hackname = ultrix_ifdef;
2222     select   = "#ifdef KERNEL";
2223     files    = sys/file.h;
2224     sed      = "s/#ifdef KERNEL/#if defined(KERNEL)/";
2225 };
2226
2227
2228 /*
2229  *  Avoid nested comments on Ultrix 4.3.
2230  */
2231 fix = {
2232     hackname = ultrix_nested_cmnt;
2233     files    = rpc/svc.h;
2234     sed      = "s@^\\( \\*\tint protocol;  \\)/\\*@\\1*/ /*@";
2235 };
2236
2237
2238 /*
2239  *  Check for superfluous `static' (in Ultrix 4.2)
2240  *  On Ultrix 4.3, includes of other files (r3_cpu.h,r4_cpu.h) is broken.
2241  */
2242 fix = {
2243     hackname = ultrix_static;
2244     files  = machine/cpu.h;
2245     select = '#include "r[34]_cpu';
2246     sed    = "s/^static struct tlb_pid_state/struct tlb_pid_state/";
2247     sed    = 's/^#include "r3_cpu\.h"$/#include <machine\/r3_cpu\.h>/';
2248     sed    = 's/^#include "r4_cpu\.h"$/#include <machine\/r4_cpu\.h>/';
2249 };
2250
2251
2252 /*
2253  *  Fix multiple defines for NULL
2254  */
2255 fix = {
2256     hackname = undefine_null;
2257     select = "^#[ \t]*define[ \t]*[ \t]NULL[ \t]";
2258     bypass = "#[ \t]*(ifn|un)def[ \t]*[ \t]NULL($|[ \t])";
2259     sed    = "/^#[ \t]*define[ \t][ \t]*NULL[ \t]/i\\\n"
2260                 "#undef NULL\n";
2261 };
2262
2263
2264 /*
2265  *  Fix definitions of macros used by va-i960.h in VxWorks header file.
2266  */
2267 fix = {
2268     hackname = va_i960_macro;
2269     files    = arch/i960/archI960.h;
2270     select   = "__(vsiz|vali|vpad|alignof__)";
2271     sed = "s/__vsiz/__vxvsiz/";
2272     sed = "s/__vali/__vxvali/";
2273     sed = "s/__vpad/__vxvpad/";
2274     sed = "s/__alignof__/__vxalignof__/";
2275 };
2276
2277
2278 /*
2279  *  AIX headers define NULL to be cast to a void pointer,
2280  *  which is illegal in ANSI C++.
2281  */
2282 fix = {
2283     hackname = void_null;
2284     files    = curses.h;
2285     files    = dbm.h;
2286     files    = locale.h;
2287     files    = stdio.h;
2288     files    = stdlib.h;
2289     files    = string.h;
2290     files    = time.h;
2291     files    = unistd.h;
2292     files    = sys/dir.h;
2293     files    = sys/param.h;
2294     files    = sys/types.h;
2295     select   = "#[ \t]*define[ \t][ \t]*NULL[ \t].*void";
2296     sed      = "s/^#[ \t]*define[ \t]*NULL[ \t]*((void[ \t]*\\*)0)"
2297                 "/#define NULL 0/";
2298 };
2299
2300
2301 /*
2302  *  Make VxWorks header which is almost gcc ready fully gcc ready.
2303  */
2304 fix = {
2305     hackname = vxworks_gcc_problem;
2306     files    = types/vxTypesBase.h;
2307     select   = "__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__";
2308
2309     sed = "s/#ifdef __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__/"
2310           "#if 1/";
2311
2312     sed = "/[ \t]size_t/i\\\n"
2313         "#ifndef _GCC_SIZE_T\\\n"
2314         "#define _GCC_SIZE_T\n";
2315
2316     sed = "/[ \t]size_t/a\\\n"
2317         "#endif\n";
2318
2319     sed = "/[ \t]ptrdiff_t/i\\\n"
2320         "#ifndef _GCC_PTRDIFF_T\\\n"
2321         "#define _GCC_PTRDIFF_T\n";
2322
2323     sed = "/[ \t]ptrdiff_t/a\\\n"
2324         "#endif\n";
2325
2326     sed = "/[ \t]wchar_t/i\\\n"
2327         "#ifndef _GCC_WCHAR_T\\\n"
2328         "#define _GCC_WCHAR_T\n";
2329
2330     sed = "/[ \t]wchar_t/a\\\n"
2331         "#endif\n";
2332 };
2333
2334
2335 /*
2336  *  Fix VxWorks <time.h> to not require including <vxTypes.h>.
2337  */
2338 fix = {
2339     hackname = vxworks_needs_vxtypes;
2340     files    = time.h;
2341     select   = "uint_t[ \t][ \t]*_clocks_per_sec";
2342     sed      = "s/uint_t/unsigned int/";
2343 };
2344
2345
2346 /*
2347  *  Fix VxWorks <sys/stat.h> to not require including <vxWorks.h>.
2348  */
2349 fix = {
2350     hackname = vxworks_needs_vxworks;
2351     files    = sys/stat.h;
2352     test     = " -r types/vxTypesOld.h";
2353     test     = " -n \"`egrep '#include' $file`\"";
2354     test     = " -n \"`egrep ULONG $file`\"";
2355     select   = "#[ \t]define[ \t][ \t]*__INCstath";
2356
2357     sed = "/#[ \t]define[ \t][ \t]*__INCstath/a\\\n"
2358           "#include <types/vxTypesOld.h>\n";
2359 };
2360
2361
2362 /*
2363  *  Another bad dependency in VxWorks 5.2 <time.h>.
2364  */
2365 fix = {
2366     hackname = vxworks_time;
2367     files    = time.h;
2368     select   = "VOIDFUNCPTR";
2369     test     = " -r vxWorks.h";
2370     sed      = "/VOIDFUNCPTR/i\\\n"
2371                "#ifndef __gcc_VOIDFUNCPTR_defined\\\n"
2372                "#ifdef __cplusplus\\\n"
2373                "typedef void (*__gcc_VOIDFUNCPTR) (...);\\\n"
2374                "#else\\\n"
2375                "typedef void (*__gcc_VOIDFUNCPTR) ();\\\n"
2376                "#endif\\\n"
2377                "#define __gcc_VOIDFUNCPTR_defined\\\n"
2378                "#endif\n";
2379
2380     sed      = "s/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g";
2381 };
2382
2383
2384 /*
2385  *  There are several name conflicts with C++ reserved words in X11 header
2386  *  files.  These are fixed in some versions, so don't do the fixes if
2387  *  we find __cplusplus in the file.  These were found on the RS/6000.
2388  */
2389 fix = {
2390     hackname = x11_class;
2391     files    = X11/ShellP.h;
2392     bypass   = __cplusplus;
2393     sed      = "/char \\*class;/i\\\n"
2394                    "#ifdef __cplusplus\\\n"
2395                    "\tchar *c_class;\\\n"
2396                    "#else\n";
2397     sed      = "/char \\*class;/a\\\n"
2398                    "#endif\n";
2399 };
2400
2401
2402 /*
2403  *  class in Xm/BaseClassI.h
2404  */
2405 fix = {
2406     hackname = x11_class_usage;
2407     files    = Xm/BaseClassI.h;
2408     bypass   = "__cplusplus";
2409     sed      = "s/ class[)]/ c_class)/g";
2410 };
2411
2412
2413 /*
2414  *  new in Xm/Traversal.h
2415  */
2416 fix = {
2417     hackname = x11_new;
2418     files    = Xm/Traversal.h;
2419     bypass   = __cplusplus;
2420
2421     sed      = "/Widget\told, new;/i\\\n"
2422                    "#ifdef __cplusplus\\\n"
2423                    "\tWidget\told, c_new;\\\n"
2424                    "#else\n";
2425
2426     sed      = "/Widget\told, new;/a\\\n"
2427                    "#endif\n";
2428
2429     sed      = "s/Widget new,/Widget c_new,/g";
2430 };
2431
2432
2433 /*
2434  *  Incorrect sprintf declaration in X11/Xmu.h
2435  */
2436 fix = {
2437     hackname = x11_sprintf;
2438     files    = X11*/Xmu.h;
2439     sed      = "s,^extern char \\*\tsprintf();$,#ifndef __STDC__\\\n"
2440                "extern char *\tsprintf();\\\n"
2441                "#endif /* !defined __STDC__ */,";
2442 };
2443
2444
2445 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2446  *
2447  *  UNDO BROKEN FIXES
2448  *
2449  *  We sure do hope that broken fixes and needed fixes are never
2450  *  applied to the same file!!  :-}
2451  */
2452
2453 /*
2454  *  Purge some HP-UX 11 files that are only borken after they are "fixed".
2455  */
2456 fix = {
2457     hackname = zzz_ki_iface;
2458     files    = sys/ki_iface.h;
2459     select   = 'These definitions are for HP Internal developers';
2460     shell    =
2461          "echo \"Removing incorrect fix to <$file>\" >&2\n"
2462          "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
2463          "cat > /dev/null";
2464 };
2465
2466
2467 /*
2468  *  Purge some HP-UX 11 files that are only borken after they are "fixed".
2469  */
2470 fix = {
2471     hackname = zzz_ki;
2472     files    = sys/ki.h;
2473     select   = '11.00 HP-UX LP64';
2474     shell    =
2475          "echo \"Removing incorrect fix to <$file>\" >&2\n"
2476          "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
2477          "cat > /dev/null";
2478 };
2479
2480
2481 /*
2482  *  Purge some HP-UX 11 files that are only borken after they are "fixed".
2483  */
2484 fix = {
2485     hackname = zzz_ki_calls;
2486     files    = sys/ki_calls.h;
2487     select   = 'kthread_create_caller_t';
2488     shell    =
2489          "echo \"Removing incorrect fix to <$file>\" >&2\n"
2490          "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
2491          "cat > /dev/null";
2492 };
2493
2494
2495 /*
2496  *  Purge some HP-UX 11 files that are only borken after they are "fixed".
2497  */
2498 fix = {
2499     hackname = zzz_ki_defs;
2500     files    = sys/ki_defs.h;
2501     select   = 'Kernel Instrumentation Definitions';
2502     shell    =
2503          "echo \"Removing incorrect fix to <$file>\" >&2\n"
2504          "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
2505          "cat > /dev/null";
2506 };
2507
2508
2509 /*
2510  *  This file on SunOS 4 has a very large macro.  When the sed loop
2511  *  tries pull it in, it overflows the pattern space size of the SunOS
2512  *  sed (GNU sed does not have this problem).  Since the file does not
2513  *  require fixing, we remove it from the fixed directory.
2514  */
2515 fix = {
2516     hackname = zzz_bad_fixes;
2517     files    = sundev/ipi_error.h;
2518     /* shouldn't there be a select expression here??? */
2519     shell    =
2520          "echo \"Removing incorrect fix to <$file>\" >&2\n"
2521          "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
2522          "cat > /dev/null";
2523 };
2524
2525
2526 /*
2527  *  Purge some HP-UX 11 files that are only borken after they are "fixed".
2528  */
2529 fix = {
2530     hackname = zzz_time;
2531     files    = sys/time.h;
2532     select   = '11.0 and later representation of ki time';
2533     shell    =
2534          "echo \"Removing incorrect fix to <$file>\" >&2\n"
2535          "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
2536          "cat > /dev/null";
2537 };
2538
2539 /*EOF*/