From: Noah Misch Date: Mon, 4 Jun 2007 22:49:41 +0000 (+0000) Subject: * doc/autoconf.texi (AC_F77_MAIN): Give a specific usage example that X-Git-Tag: v2.62~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77ad2865a2326fe8a93a5cb3e2f39dbab56bd1b2;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (AC_F77_MAIN): Give a specific usage example that works with both C and C++. --- diff --git a/ChangeLog b/ChangeLog index 9e3e15aa..4c96f1e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-04 Noah Misch + + * doc/autoconf.texi (AC_F77_MAIN): Give a specific usage example that + works with both C and C++. + 2007-06-03 Noah Misch , Bruno Haible diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 1bb7978e..7268a592 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -7094,8 +7094,16 @@ alternate main function name is found, @code{F77_MAIN} and @code{FC_MAIN} are simply defined to @code{main}.) Thus, when calling Fortran routines from C that perform things like I/O, -one should use this macro and name the "main" function -@code{F77_MAIN} or @code{FC_MAIN} instead of @code{main}. +one should use this macro and declare the "main" function like so: + +@example +#ifdef __cplusplus + extern "C" +#endif +int F77_MAIN(int argc, char *argv[]); +@end example + +(Again, replace @code{F77} with @code{FC} for Fortran instead of Fortran 77.) @end defmac @defmac AC_F77_WRAPPERS