https://issues.dlang.org/show_bug.cgi?id=24011

Walter Bright <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Walter Bright <[email protected]> ---
Oh, I know what's wrong. The line:

    extern FILE *fopen (const char *__restrict __filename,
      const char *__restrict __modes) ;

ImportC doesn't recognize the __restrict keyword. (__restrict is not a C11
Standard keyword.). When ImportC runs the preprocessor, it also implicitly
#include's the file druntime/src/importc.h, which #define's `__restrict` to
nothing.

ImportC is rather heavily reliant on importc.h to adjust the wild extensions in
various C compilers to something that ImportC can swill on (the ugly
alternative is for ImportC to implement everybody else's extension).

The solution, for your case, is to have gcc use importc.h as well:

    gcc -E -include <path-to-importc>importc.h test.c > test.i

where <path-to-importc> is where importc.h is on your system.

--

Reply via email to