On Wed, 16 Jan 2019, Joseph Myers wrote: > On Wed, 16 Jan 2019, Jakub Jelinek wrote: > > > In normal C headers, we can #if __WORDSIZE == 32 or __SIZEOF_LONG__ == 4 or > > defined(__ILP64__) and similar, but in these headers we can't, as no > > preprocessing is happening. > > (With such preprocessing, the mechanism glibc uses for gnu/stubs.h and > gnu/lib-names.h could be used.)
And I guess this leads to the question: Since the Fortran front end has preprocessing support, could it be made to run the preprocessor on such preincluded headers? If it could, the driver code could be changed to avoid looking in multilib locations for this header, and that glibc machinery could be used. (It would be necessary to resolve the FIXME in fortran/cpp.c so that architecture-specific macros get predefined; __x86_64__, __LP64__ and __ILP32__ all need to be properly defined or not defined for this mechanism to work for x86.) -- Joseph S. Myers jos...@codesourcery.com