From 37c9f67474a1361512677f00ccf51de259334171 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 12 Dec 1994 08:04:24 -0500 Subject: [PATCH] (vms_fopen): Call `fopen' through an indirect pointer to inhibit checking argument list against its prototype. (vms_fopen): Call `fopen' through an indirect pointer to inhibit checking argument list against its prototype. Increase RMS multi-block count from 16 to 32. From-SVN: r8644 --- gcc/cccp.c | 13 ++++++++++--- gcc/toplev.c | 19 +++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/gcc/cccp.c b/gcc/cccp.c index 0c736373b237..20bd11946dde 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -9967,9 +9967,16 @@ fopen (fname, type) char *type; { #undef fopen /* Get back the REAL fopen routine */ - if (strcmp (type, "w") == 0) - return fopen (fname, type, "mbc=16", "deq=64", "fop=tef", "shr=nil"); - return fopen (fname, type, "mbc=16"); + /* The gcc-vms-1.42 distribution's header files prototype fopen with two + fixed arguments, which matches ANSI's specification but not VAXCRTL's + pre-ANSI implmentation. This hack circumvents the mismatch problem. */ + FILE *(*vmslib_fopen)() = (FILE *(*)()) fopen; + + if (*type == 'w') + return (*vmslib_fopen) (fname, type, "mbc=32", + "deq=64", "fop=tef", "shr=nil"); + else + return (*vmslib_fopen) (fname, type, "mbc=32"); } static int diff --git a/gcc/toplev.c b/gcc/toplev.c index f4dc8657b711..62c34f0aa56b 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -71,16 +71,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef VMS /* The extra parameters substantially improve the I/O performance. */ static FILE * -VMS_fopen (fname, type) +vms_fopen (fname, type) char * fname; char * type; { - if (strcmp (type, "w") == 0) - return fopen (fname, type, "mbc=16", "deq=64", "fop=tef", "shr=nil"); - return fopen (fname, type, "mbc=16"); + /* The in the gcc-vms-1.42 distribution prototypes fopen with two + fixed arguments, which matches ANSI's specification but not VAXCRTL's + pre-ANSI implementation. This hack circumvents the mismatch problem. */ + FILE *(*vmslib_fopen)() = (FILE *(*)()) fopen; + + if (*type == 'w') + return (*vmslib_fopen) (fname, type, "mbc=32", + "deq=64", "fop=tef", "shr=nil"); + else + return (*vmslib_fopen) (fname, type, "mbc=32"); } -#define fopen VMS_fopen -#endif +#define fopen vms_fopen +#endif /* VMS */ #ifndef DEFAULT_GDB_EXTENSIONS #define DEFAULT_GDB_EXTENSIONS 1 -- 2.43.5