This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to remove __cplusplus extern "C" gunk from libf2c


This patch deletes the __cplusplus extern "C" gunk from libf2c.  Note
I didn't remove it from the external interface header g2c.hin, just
from the internal files.  So one can still *link* C++ code with
libf2c.  What I'm removing is the ability to supposedly *build* libf2c
with a C++ compiler. :-)

Ok to install?

		Thanks,
		--Kaveh


2002-05-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* libF77/F77_aloc.c, libF77/exit_.c, libF77/main.c,
	libF77/s_paus.c, libF77/s_stop.c, libF77/setarg.c,
	libF77/setsig.c, libF77/sig_die.c, libF77/signal1.h0,
	libI77/close.c, libI77/dolio.c, libI77/fio.h, libI77/fmt.h,
	libI77/lio.h: Delete checks on __cplusplus.
	
diff -rup orig/egcc-CVS20020530/libf2c/libF77/F77_aloc.c egcc-CVS20020530/libf2c/libF77/F77_aloc.c
--- orig/egcc-CVS20020530/libf2c/libF77/F77_aloc.c	2002-05-31 10:01:08.972988598 -0400
+++ egcc-CVS20020530/libf2c/libF77/F77_aloc.c	2002-05-31 10:02:43.113406806 -0400
@@ -7,13 +7,7 @@
 static integer memfailure = 3;
 
 #include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
 extern void G77_exit_0 (integer*);
-#ifdef __cplusplus
-	}
-#endif
 
  char *
 F77_aloc(integer Len, char *whence)
diff -rup orig/egcc-CVS20020530/libf2c/libF77/exit_.c egcc-CVS20020530/libf2c/libF77/exit_.c
--- orig/egcc-CVS20020530/libf2c/libF77/exit_.c	2002-05-31 10:01:09.022989061 -0400
+++ egcc-CVS20020530/libf2c/libF77/exit_.c	2002-05-31 10:03:09.090760402 -0400
@@ -13,9 +13,6 @@
 #undef min
 #undef max
 #include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
 extern void f_exit(void);
 
  void
@@ -26,6 +23,3 @@ G77_exit_0 (integer *rc)
 #endif
 	exit(*rc);
 	}
-#ifdef __cplusplus
-}
-#endif
diff -rup orig/egcc-CVS20020530/libf2c/libF77/main.c egcc-CVS20020530/libf2c/libF77/main.c
--- orig/egcc-CVS20020530/libf2c/libF77/main.c	2002-05-31 10:01:09.052988970 -0400
+++ egcc-CVS20020530/libf2c/libF77/main.c	2002-05-31 10:04:16.943808815 -0400
@@ -10,10 +10,6 @@
 #define VOID void
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 extern void f_exit(void);
 #ifndef NO_ONEXIT
 #define ONEXIT atexit
@@ -23,10 +19,6 @@ extern int atexit(void (*)(void));
 extern void f_init(void);
 extern int MAIN__(void);
 
-#ifdef __cplusplus
-	}
-#endif
-
 main(int argc, char **argv)
 {
 f_setarg(argc, argv);
diff -rup orig/egcc-CVS20020530/libf2c/libF77/s_paus.c egcc-CVS20020530/libf2c/libF77/s_paus.c
--- orig/egcc-CVS20020530/libf2c/libF77/s_paus.c	2002-05-31 10:01:09.082989320 -0400
+++ egcc-CVS20020530/libf2c/libF77/s_paus.c	2002-05-31 10:04:27.582681851 -0400
@@ -9,9 +9,6 @@
 #undef min
 #undef max
 #include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
 extern int getpid(void), isatty(int), pause(void);
 
 extern VOID f_exit(Void);
@@ -69,7 +66,4 @@ s_paus(char *s, ftnlen n)
 	fprintf(stderr, "Execution resumes after PAUSE.\n");
 	fflush(stderr);
 	return 0; /* NOT REACHED */
-#ifdef __cplusplus
-	}
-#endif
 }
diff -rup orig/egcc-CVS20020530/libf2c/libF77/s_stop.c egcc-CVS20020530/libf2c/libF77/s_stop.c
--- orig/egcc-CVS20020530/libf2c/libF77/s_stop.c	2002-05-31 10:01:09.082989320 -0400
+++ egcc-CVS20020530/libf2c/libF77/s_stop.c	2002-05-31 10:04:41.241356830 -0400
@@ -5,9 +5,6 @@
 #undef min
 #undef max
 #include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
 void f_exit(void);
 
 int s_stop(char *s, ftnlen n)
@@ -32,6 +29,3 @@ exit(0);
 
 return 0; /* NOT REACHED */
 }
-#ifdef __cplusplus
-}
-#endif
diff -rup orig/egcc-CVS20020530/libf2c/libF77/setarg.c egcc-CVS20020530/libf2c/libF77/setarg.c
--- orig/egcc-CVS20020530/libf2c/libF77/setarg.c	2002-05-31 10:01:09.092989236 -0400
+++ egcc-CVS20020530/libf2c/libF77/setarg.c	2002-05-31 10:04:52.460131614 -0400
@@ -11,10 +11,6 @@
 int f__xargc;
 char **f__xargv;
 
-#ifdef __cplusplus
-	}
-#endif
-
  void
 f_setarg(int argc, char **argv)
 {
diff -rup orig/egcc-CVS20020530/libf2c/libF77/setsig.c egcc-CVS20020530/libf2c/libF77/setsig.c
--- orig/egcc-CVS20020530/libf2c/libF77/setsig.c	2002-05-31 10:01:09.092989236 -0400
+++ egcc-CVS20020530/libf2c/libF77/setsig.c	2002-05-31 10:05:05.438813979 -0400
@@ -16,10 +16,6 @@
 #define VOID void
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 extern void sig_die(char*, int);
 #define Int int
 
@@ -66,10 +62,6 @@ sig_die("Trace trap", 1);
 #endif
 
 
-#ifdef __cplusplus
-	}
-#endif
-
  void
 f_setsig()
 {
diff -rup orig/egcc-CVS20020530/libf2c/libF77/sig_die.c egcc-CVS20020530/libf2c/libF77/sig_die.c
--- orig/egcc-CVS20020530/libf2c/libF77/sig_die.c	2002-05-31 10:01:09.092989236 -0400
+++ egcc-CVS20020530/libf2c/libF77/sig_die.c	2002-05-31 10:05:17.257708718 -0400
@@ -8,9 +8,6 @@
 #endif
 
 #include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
  extern void f_exit(void);
 
 void sig_die(register char *s, int kill)
@@ -36,6 +33,3 @@ void sig_die(register char *s, int kill)
 		exit(1);
 		}
 	}
-#ifdef __cplusplus
-}
-#endif
diff -rup orig/egcc-CVS20020530/libf2c/libF77/signal1.h0 egcc-CVS20020530/libf2c/libF77/signal1.h0
--- orig/egcc-CVS20020530/libf2c/libF77/signal1.h0	2002-05-31 10:01:09.092989236 -0400
+++ egcc-CVS20020530/libf2c/libF77/signal1.h0	2002-05-31 10:05:56.813659546 -0400
@@ -22,10 +22,5 @@ typedef Sigret_t (*sig_pf)(Sigarg_t);
 
 #define signal1(a,b) signal(a,(sig_pf)b)
 
-#ifdef __cplusplus
-#define Sigarg ...
-#define Use_Sigarg
-#else
 #define Sigarg Int n
 #define Use_Sigarg n = n	/* shut up compiler warning */
-#endif
diff -rup orig/egcc-CVS20020530/libf2c/libI77/close.c egcc-CVS20020530/libf2c/libI77/close.c
--- orig/egcc-CVS20020530/libf2c/libI77/close.c	2002-05-31 10:01:09.112989509 -0400
+++ egcc-CVS20020530/libf2c/libI77/close.c	2002-05-31 10:06:20.481209116 -0400
@@ -14,13 +14,9 @@
 #if defined (MSDOS) && !defined (GO32)
 #include "io.h"
 #else
-#ifdef __cplusplus
-extern "C" int unlink(const char*);
-#else
 extern int unlink(const char*);
 #endif
 #endif
-#endif
 
 integer f_clos(cllist *a)
 {	unit *b;
diff -rup orig/egcc-CVS20020530/libf2c/libI77/dolio.c egcc-CVS20020530/libf2c/libI77/dolio.c
--- orig/egcc-CVS20020530/libf2c/libI77/dolio.c	2002-05-31 10:01:09.122989486 -0400
+++ egcc-CVS20020530/libf2c/libI77/dolio.c	2002-05-31 10:06:39.699270755 -0400
@@ -1,15 +1,9 @@
 #include "config.h"
 #include "f2c.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 extern int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint);
 
 integer do_lio(ftnint *type, ftnint *number, char *ptr, ftnlen len)
 {
 	return((*f__lioproc)(number,ptr,len,*type));
 }
-#ifdef __cplusplus
-	}
-#endif
diff -rup orig/egcc-CVS20020530/libf2c/libI77/fio.h egcc-CVS20020530/libf2c/libI77/fio.h
--- orig/egcc-CVS20020530/libf2c/libI77/fio.h	2002-05-31 10:01:09.122989486 -0400
+++ egcc-CVS20020530/libf2c/libI77/fio.h	2002-05-31 10:07:11.866006031 -0400
@@ -60,9 +60,6 @@ extern cilist *f__elist;	/*active extern
 extern flag f__reading,f__external,f__sequential,f__formatted;
 #undef Void
 #define Void void
-#ifdef __cplusplus
-extern "C" {
-#endif
 extern int (*f__getn)(void);	/* for formatted input */
 extern void (*f__putn)(int);	/* for formatted output */
 extern void x_putc(int);
@@ -81,9 +78,6 @@ extern int isatty(int);
 extern int err__fl(int,int,char*);
 extern int xrd_SL(void);
 extern int f__putbuf(int);
-#ifdef __cplusplus
-	}
-#endif
 extern int (*f__doend)(Void);
 extern FILE *f__cf;	/*current file*/
 extern unit *f__curunit;	/*current unit*/
diff -rup orig/egcc-CVS20020530/libf2c/libI77/fmt.h egcc-CVS20020530/libf2c/libI77/fmt.h
--- orig/egcc-CVS20020530/libf2c/libI77/fmt.h	2002-05-31 10:01:09.132989602 -0400
+++ egcc-CVS20020530/libf2c/libI77/fmt.h	2002-05-31 10:07:26.684475667 -0400
@@ -53,9 +53,6 @@ typedef union
 	longint ili;
 #endif
 } Uint;
-#ifdef __cplusplus
-extern "C" {
-#endif
 extern int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*);
 extern int (*f__dorevert)(void);
 extern void fmt_bg(void);
@@ -65,9 +62,6 @@ extern int w_ed(struct syl*, char*, ftnl
 extern int wrt_E(ufloat*, int, int, int, ftnlen);
 extern int wrt_F(ufloat*, int, int, ftnlen);
 extern int wrt_L(Uint*, int, ftnlen);
-#ifdef __cplusplus
-	}
-#endif
 extern flag f__cblank,f__cplus,f__workdone, f__nonl;
 extern char *f__fmtbuf;
 extern int f__fmtlen;
diff -rup orig/egcc-CVS20020530/libf2c/libI77/lio.h egcc-CVS20020530/libf2c/libI77/lio.h
--- orig/egcc-CVS20020530/libf2c/libI77/lio.h	2002-05-31 10:01:09.142989559 -0400
+++ egcc-CVS20020530/libf2c/libI77/lio.h	2002-05-31 10:07:38.893254909 -0400
@@ -54,9 +54,6 @@ typedef union
 	doublereal	fldouble;
 } flex;
 extern int f__scale;
-#ifdef __cplusplus
-extern "C" {
-#endif
 extern int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint);
 extern int l_write(ftnint*, char*, ftnlen, ftnint);
 extern void x_wsne(cilist*);
@@ -64,7 +61,4 @@ extern int c_le(cilist*), (*l_getc)(void
 extern int l_read(ftnint*,char*,ftnlen,ftnint);
 extern integer e_rsle(void), e_wsle(void), s_wsne(cilist*);
 extern int z_rnew(void);
-#ifdef __cplusplus
-	}
-#endif
 extern ftnint L_len;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]