]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (AC_F77_MAIN): Give a specific usage example that
authorNoah Misch <noah@cs.caltech.edu>
Mon, 4 Jun 2007 22:49:41 +0000 (22:49 +0000)
committerNoah Misch <noah@cs.caltech.edu>
Mon, 4 Jun 2007 22:49:41 +0000 (22:49 +0000)
works with both C and C++.

ChangeLog
doc/autoconf.texi

index 9e3e15aa4acc41d112fde933f59f8622f07f3e6f..4c96f1e430085c6dfc07239370e5bdd3309c9672 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-04  Noah Misch  <noah@cs.caltech.edu>
+
+       * doc/autoconf.texi (AC_F77_MAIN): Give a specific usage example that
+       works with both C and C++.
+
 2007-06-03  Noah Misch  <noah@cs.caltech.edu>,
            Bruno Haible  <bruno@clisp.org>
 
index 1bb7978ed1b6fce898138684be4c4213b81dc98b..7268a59263e9d6511fdc8a8833e67d5d5b1ada60 100644 (file)
@@ -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