On Fri, 15 Apr 2005, Norman Gray wrote:
> There are two other possibilities. One would be to create a function
> which returned a backslash, since that would be fixed when the library
> containing it was compiled. The other would be to something tricksy
> with an integer*1 holding 0x5c, and an EQUIVALENCE with a character
> constant. Too grim?
Hi Norman,
it's occurred to me that we've been thinking about this one too hard and
only looking for grim solutions (must be catching after all that
autoconfing). In fact remembering how Fortran strings work leads to this
inclusion in CCDPACK:
* Printable backslash: some compilers need '\\' to get '\', which
* isn't a problem as Fortran will truncate the string '\\' to '\'
* on the occasions when that isn't needed.
CHARACTER * ( 1 ) CCD1__BKSLH
PARAMETER ( CCD1__BKSLH = '\\' )
Since the declared string has length _1_. So all we really need to do is
parameterise each use of backslash to use a constant declared as above.
I'll leave it up to you to decide if the AC_FC_LITERAL_BACKSLASH has other
uses and should be retained (yes if the ability to test '\n'-v-'\\n' and
friends is needed, although pedantically that could become
"CCD1__BKSLH//'n'" in this case).
Cheers,
Peter.
|