Commit 4b60eb3b by John David Anglin Committed by John David Anglin

inclhack.def (hpux10_stdio_declarations, [...]): New hacks.

	* fixinc/inclhack.def (hpux10_stdio_declarations, ultrix_const3,
	ultrix_locale, ultrix_stdlib, ultrix_strings, ultrix_sys_time,
	ultrix_unistd): New hacks.
	* fixinc/tests/base/stdio.h (HPUX10_STDIO_DECLARATIONS_CHECK,
	ULTRIX_CONST2_CHECK): Add checks.
	* fixinc/tests/base/stdlib.h (ULTRIX_STDLIB_CHECK): Likewise.
	* fixinc/tests/base/strings.h (ULTRIX_STRINGS2_CHECK): Likewise.
	* fixinc/tests/base/unistd.h (ULTRIX_UNISTD_CHECK): Likewise.
	* fixinc/tests/base/sys/time.h (ULTRIX_SYS_TIME_CHECK): Likewise.
	* fixinc/tests/base/locale.h: New file.
	* fixinc/fixincl.x: Rebuilt.

From-SVN: r76298
parent dd69a0e0
2004-01-21 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* fixinc/inclhack.def (hpux10_stdio_declarations, ultrix_const3,
ultrix_locale, ultrix_stdlib, ultrix_strings, ultrix_sys_time,
ultrix_unistd): New hacks.
* fixinc/tests/base/stdio.h (HPUX10_STDIO_DECLARATIONS_CHECK,
ULTRIX_CONST2_CHECK): Add checks.
* fixinc/tests/base/stdlib.h (ULTRIX_STDLIB_CHECK): Likewise.
* fixinc/tests/base/strings.h (ULTRIX_STRINGS2_CHECK): Likewise.
* fixinc/tests/base/unistd.h (ULTRIX_UNISTD_CHECK): Likewise.
* fixinc/tests/base/sys/time.h (ULTRIX_SYS_TIME_CHECK): Likewise.
* fixinc/tests/base/locale.h: New file.
* fixinc/fixincl.x: Rebuilt.
2004-01-21 Andreas Jaeger <aj@suse.de>
Michael Matz <matz@suse.de>
......
......@@ -1266,6 +1266,28 @@ fix = {
/*
* Fix hpux 10.X missing stdio declarations
*/
fix = {
hackname = hpux10_stdio_declarations;
files = stdio.h;
select = "^#[ \t]*define _iob[ \t]*__iob";
bypass = "^[ \t]*extern[ \t]*int[ \t]*vsnprintf[ \t]*\\(";
c_fix = format;
c_fix_arg = "%0\n\n"
"# if defined(__STDC__) || defined(__cplusplus)\n"
" extern int snprintf(char *, size_t, const char *, ...);\n"
" extern int vsnprintf(char *, size_t, const char *, __va_list);\n"
"# else /* not __STDC__) || __cplusplus */\n"
" extern int snprintf();\n"
" extern int vsnprintf();\n"
"# endif /* __STDC__) || __cplusplus */\n";
test_text = "# define _iob __iob\n";
};
/*
* Make sure hpux defines abs in header.
*/
fix = {
......@@ -3446,6 +3468,24 @@ fix = {
/*
* parameters not const on Ultrix V4.3.
*/
fix = {
hackname = ultrix_const3;
files = stdio.h;
select = 'fdopen\( .*, char \*';
c_fix = format;
c_fix_arg = "%1 const %3 *__";
c_fix_arg = "([ \t*](fdopen)\\(.*)"
"[ \t]+(char|void) \\*__";
test_text =
"extern FILE * fdopen( int __filedes, char *__type );\n";
};
/*
* Ultrix V4.[35] puts the declaration of uname before the definition
* of struct utsname, so the prototype (added by fixproto) causes havoc.
*/
......@@ -3480,6 +3520,19 @@ fix = {
/*
* Add once-only latch to Ultrix V4.3 locale.h.
*/
fix = {
hackname = ultrix_locale;
files = locale.h;
select = "@\\(#\\)locale\\.h.*6\\.1.*\\(ULTRIX\\)";
c_fix = wrap;
test_text =
"@(#)locale.h 6.1 (ULTRIX)\n";
};
/*
* Strip "|| CC$gfloat" from Ultrix math headers.
*/
fix = {
......@@ -3559,6 +3612,31 @@ fix = {
/*
* Add missing declarations to Ultrix V4.3 stdlib.h.
*/
fix = {
hackname = ultrix_stdlib;
files = stdlib.h;
select = "@\\(#\\)stdlib\\.h.*6\\.1.*\\(ULTRIX\\)";
sed = "/^char.*getenv( const char .* );.*$/a\\\n"
"int\t\tsetenv( const char *__name, const char *__val, int __ovrwrt );\\\n"
"void\t\tunsetenv( const char *__name );\\\n"
"int\t\tputenv( char *__s );\n";
sed = "/^char.*getenv();.*$/a\\\n"
"int\tsetenv();\\\n"
"void\tunsetenv();\\\n"
"int\tputenv();\n";
test_text =
"@(#)stdlib.h 6.1 (ULTRIX)\n"
"char * getenv( const char *__name );\n"
"char *getenv();\n";
};
/*
* Add once-only latch to Ultrix V4.3 strings.h.
*/
fix = {
......@@ -3572,6 +3650,91 @@ fix = {
/*
* Add missing declarations to Ultrix V4.3 strings.h.
*/
fix = {
hackname = ultrix_strings2;
files = strings.h;
select = "@\\(#\\)strings\\.h.*6\\.1.*\\(ULTRIX\\)";
sed = "/^.*strncmp( const .* );.*/a\\\n"
"\\\n"
"extern int\\\n"
"\tstrcasecmp( const char *__s1, const char *__s2),\\\n"
"\tstrncasecmp( const char *__s1, const char *__s2, size_t __n );\n";
sed = "/^.*strncmp();.*/a\\\n"
"extern int\\\n"
"\tstrcasecmp(),\\\n"
"\tstrncasecmp();\n";
test_text =
"@(#)strings.h 6.1 (ULTRIX)\n"
"\tstrncmp( const char *__s1, const char *__s2, size_t __n );\n"
"\tstrncmp();\n";
};
/*
* Add missing declarations to Ultrix V4.3 sys/time.h.
*/
fix = {
hackname = ultrix_sys_time;
files = sys/time.h;
select = "@\\(#\\)time\\.h.*6\\.1.*\\(ULTRIX\\)";
sed = "/^extern.*time_t.*time( time_t .* );.*$/a\\\n"
"\\\n"
"extern int adjtime(struct timeval *, struct timeval *);\\\n"
"extern int getitimer(int, struct itimerval *);\\\n"
"extern int setitimer(int, struct itimerval *, struct itimerval *);\\\n"
"extern int gettimeofday(struct timeval *, struct timezone *);\\\n"
"extern int settimeofday(struct timeval *, struct timezone *);\\\n"
"extern void profil(const void *, size_t, size_t, unsigned int);\\\n"
"extern int stime(const time_t *);\\\n"
"extern int utimes(const char *, const struct timeval[2]);\\\n"
"extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);\n";
sed = "/^extern.*double.*difftime();.*$/a\\\n"
"extern\tint adjtime();\\\n"
"extern\tint getitimer();\\\n"
"extern\tint setitimer();\\\n"
"extern\tint gettimeofday();\\\n"
"extern\tint settimeofday();\\\n"
"extern\tvoid profil();\\\n"
"extern\tint stime();\\\n"
"extern\tint utimes();\\\n"
"extern\tint select();\n";
test_text =
"@(#)time.h 6.1 (ULTRIX)\n"
"extern time_t time( time_t *__tloc );\n"
"extern double difftime();\n";
};
/*
* Add missing declarations to Ultrix V4.3 unistd.h.
*/
fix = {
hackname = ultrix_unistd;
files = unistd.h;
select = "@\\(#\\)unistd\\.h.*6\\.1.*\\(ULTRIX\\)";
sed = "/^[ \t]*getgroups(),.*$/a\\\n"
"\tgetpagesize(),\n";
sed = "/^[ \t]*fork(),.*$/a\\\n"
"\tvfork(),\n";
test_text =
"@(#)unistd.h 6.1 (ULTRIX)\n"
"\tgetgroups(),\n"
"\tfork(),\n";
};
/*
* Fix multiple defines for NULL. Sometimes, we stumble into \r\n
* terminated lines, so accommodate these. Test both ways.
* Don't bother to reproduce the \r\n termination, as GCC has to
......
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/locale.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#ifndef FIXINC_WRAP_LOCALE_H_ULTRIX_LOCALE
#define FIXINC_WRAP_LOCALE_H_ULTRIX_LOCALE 1
#if defined( ULTRIX_LOCALE_CHECK )
@(#)locale.h 6.1 (ULTRIX)
#endif /* ULTRIX_LOCALE_CHECK */
#endif /* FIXINC_WRAP_LOCALE_H_ULTRIX_LOCALE */
......@@ -26,6 +26,12 @@ int vfscanf(FILE *, const char *, __builtin_va_list) __asm__ (_BSD_STRING(__USER
#endif /* BSD_STDIO_ATTRS_CONFLICT_CHECK */
#if defined( HPUX10_STDIO_DECLARATIONS_CHECK )
# define _iob __iob
#endif /* HPUX10_STDIO_DECLARATIONS_CHECK */
#if defined( HPUX11_SNPRINTF_CHECK )
extern int snprintf(char *, size_t, const char *, ...);
extern int snprintf(char *, _hpux_size_t, const char *, ...);
......@@ -90,6 +96,12 @@ extern char *tempnam( const char *, const char *);
#endif /* ULTRIX_CONST2_CHECK */
#if defined( ULTRIX_CONST3_CHECK )
extern FILE * fdopen( int __filedes, const char *__type );
#endif /* ULTRIX_CONST3_CHECK */
#if defined( UNICOSMK_RESTRICT_CHECK )
void f (char * __restrict__ x);
#endif /* UNICOSMK_RESTRICT_CHECK */
......
......@@ -50,3 +50,17 @@ extern void * bsearch(void*,size_t,size_t);
int atexit( void (*__func)( void ) );
#endif /* ULTRIX_ATEXIT_PARAM_CHECK */
#if defined( ULTRIX_STDLIB_CHECK )
@(#)stdlib.h 6.1 (ULTRIX)
char * getenv( const char *__name );
int setenv( const char *__name, const char *__val, int __ovrwrt );
void unsetenv( const char *__name );
int putenv( char *__s );
char *getenv();
int setenv();
void unsetenv();
int putenv();
#endif /* ULTRIX_STDLIB_CHECK */
......@@ -22,4 +22,19 @@
#endif /* ULTRIX_STRINGS_CHECK */
#if defined( ULTRIX_STRINGS2_CHECK )
@(#)strings.h 6.1 (ULTRIX)
strncmp( const char *__s1, const char *__s2, size_t __n );
extern int
strcasecmp( const char *__s1, const char *__s2),
strncasecmp( const char *__s1, const char *__s2, size_t __n );
strncmp();
extern int
strcasecmp(),
strncasecmp();
#endif /* ULTRIX_STRINGS2_CHECK */
#endif /* FIXINC_WRAP_STRINGS_H_ULTRIX_STRINGS */
......@@ -12,3 +12,30 @@
#if defined( HPUX_SYSTIME_CHECK )
struct sigevent;
#endif /* HPUX_SYSTIME_CHECK */
#if defined( ULTRIX_SYS_TIME_CHECK )
@(#)time.h 6.1 (ULTRIX)
extern time_t time( time_t *__tloc );
extern int adjtime(struct timeval *, struct timeval *);
extern int getitimer(int, struct itimerval *);
extern int setitimer(int, struct itimerval *, struct itimerval *);
extern int gettimeofday(struct timeval *, struct timezone *);
extern int settimeofday(struct timeval *, struct timezone *);
extern void profil(const void *, size_t, size_t, unsigned int);
extern int stime(const time_t *);
extern int utimes(const char *, const struct timeval[2]);
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
extern double difftime();
extern int adjtime();
extern int getitimer();
extern int setitimer();
extern int gettimeofday();
extern int settimeofday();
extern void profil();
extern int stime();
extern int utimes();
extern int select();
#endif /* ULTRIX_SYS_TIME_CHECK */
......@@ -21,3 +21,13 @@ extern pid_t getpgid(pid_t);
extern int getpagesize();
extern int getpgid();
#endif /* SOLARIS_UNISTD_CHECK */
#if defined( ULTRIX_UNISTD_CHECK )
@(#)unistd.h 6.1 (ULTRIX)
getgroups(),
getpagesize(),
fork(),
vfork(),
#endif /* ULTRIX_UNISTD_CHECK */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment