From: Steven G. Johnson Date: Thu, 12 Apr 2001 02:59:07 +0000 (+0000) Subject: Mention C++ as well as C. In the example, don't #ifdef F77_FUNC X-Git-Tag: autoconf-2.50~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=304bc7147136712afa3434ede5aae84d56a32b43;p=thirdparty%2Fautoconf.git Mention C++ as well as C. In the example, don't #ifdef F77_FUNC before using it, as that would push any errors to link-time rather than compile-time; note that the user can test this to invoke alternative behavior. --- diff --git a/doc/autoconf.texi b/doc/autoconf.texi index c979566c0..585f54d9e 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -4466,9 +4466,9 @@ libraries. @cvindex F77_FUNC @cvindex F77_FUNC_ Defines C macros @code{F77_FUNC(name,NAME)} and -@code{F77_FUNC_(name,NAME)} to properly mangle the names of C -identifiers, and C identifiers with underscores, respectively, so that -they match the name mangling scheme used by the Fortran 77 compiler. +@code{F77_FUNC_(name,NAME)} to properly mangle the names of C/C++ +identifiers, and identifiers with underscores, respectively, so that +they match the name-mangling scheme used by the Fortran 77 compiler. Fortran 77 is case-insensitive, and in order to achieve this the Fortran 77 compiler converts all identifiers into a canonical case and format. @@ -4487,12 +4487,10 @@ Fortran 77 subroutine: end @end example -You would then declare its prototype in C as: +You would then declare its prototype in C or C++ as: @example -#ifdef F77_FUNC -# define FOOBAR_F77 F77_FUNC(foobar,FOOBAR) -#endif +#define FOOBAR_F77 F77_FUNC(foobar,FOOBAR) #ifdef __cplusplus extern "C" /* prevent C++ name mangling */ #endif @@ -4507,9 +4505,10 @@ Automake}). Although Autoconf tries to be intelligent about detecting the name-mangling scheme of the Fortran 77 compiler, there may be Fortran 77 -compilers that it doesn't support yet. It is therefore recommended that -you test whether the @code{F77_FUNC} and @code{F77_FUNC_} macros are -defined, as we have done in the example above. +compilers that it doesn't support yet. In this case, the above code +will generate a compile-time error, but some other behavior +(e.g. disabling Fortran-related features) can be induced by checking +whether the @code{F77_FUNC} macro is defined. Now, to call that routine from a C program, we would do something like: