aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixinc/inclhack.def
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>2004-01-21 20:08:22 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2004-01-21 20:08:22 +0000
commit4b60eb3b4a97b0f3fb6c2659c05a870da4ecef21 (patch)
treeb773c74895d69c7da8c863cdba4473ad83c0fa7f /gcc/fixinc/inclhack.def
parentdd69a0e038b94aca96bb0028ac1279ac243ba4e5 (diff)
downloadgcc-4b60eb3b4a97b0f3fb6c2659c05a870da4ecef21.zip
gcc-4b60eb3b4a97b0f3fb6c2659c05a870da4ecef21.tar.gz
gcc-4b60eb3b4a97b0f3fb6c2659c05a870da4ecef21.tar.bz2
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
Diffstat (limited to 'gcc/fixinc/inclhack.def')
-rw-r--r--gcc/fixinc/inclhack.def163
1 files changed, 163 insertions, 0 deletions
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 9459f87..a052274 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -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