Thread overview
try importC on macOS, get this error
Mar 16, 2023
d007
Mar 16, 2023
d007
Mar 16, 2023
Dave P.
Mar 16, 2023
d007
March 16, 2023

try with lastest ldc:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h(137): Error: found `_close` when expecting `)`
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h(137): Error: `;` or `,` expected
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h(138): Error: found `_read` when expecting `)`
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h(138): Error: `;` or `,` expected
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h(139): Error: found `_seek` when expecting `)`
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h(139): Error: `;` or `,` expected
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h(140): Error: found `_write` when expecting `)`
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h(140): Error: `;` or `,` expected
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h(153): Error: missing comma or semicolon after declaration of `fopen`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h(157): Error: missing comma or semicolon after declaration of `fputs`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h(160): Error: missing comma or semicolon after declaration of `freopen`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h(165): Error: missing comma or semicolon after declaration of `fwrite`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h(227): Error: missing comma or semicolon after declaration of `fdopen`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h(244): Error: missing comma or semicolon after declaration of `popen`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h(314): Error: missing comma or semicolon after declaration of `tempnam`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h(567): Error: missing comma or semicolon after declaration of `getrlimit`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h(573): Error: missing comma or semicolon after declaration of `setrlimit`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h(248): Error: missing comma or semicolon after declaration of `wait`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h(249): Error: missing comma or semicolon after declaration of `waitpid`, found `__asm` instead
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h(251): Error: missing comma or semicolon after declaration of `waitid`, found `__asm` instead
March 16, 2023
A few potential bug reports:

https://issues.dlang.org/show_bug.cgi?id=22161
https://issues.dlang.org/show_bug.cgi?id=23725
https://issues.dlang.org/show_bug.cgi?id=22722

It may also be required if we want out of the box support on Windows, as the mingw headers also use inline assembly (which errors out).
March 16, 2023

On Thursday, 16 March 2023 at 05:52:21 UTC, d007 wrote:

>

try with lastest ldc:

[...]

ldc2 does not run the c-preprocessor yet. See the below for an example of how you can currently do it:

// foo.c
#include <stdio.h>
int main(){
    printf("hello\n");
    return 0;
}

Included with your ldc install is an importc.h that you’ll need to include to macro away some constructs D doesn’t understand.

You can then build as so:

$ clang -E foo.c -o foo.i -include  $LDC_INSTALL/import/importc.h
$ ldc2 foo.i
$ ./foo

Which prints hello.

March 16, 2023

On Thursday, 16 March 2023 at 06:30:51 UTC, Dave P. wrote:

>

On Thursday, 16 March 2023 at 05:52:21 UTC, d007 wrote:

>

try with lastest ldc:

[...]

ldc2 does not run the c-preprocessor yet. See the below for an example of how you can currently do it:

// foo.c
#include <stdio.h>
int main(){
    printf("hello\n");
    return 0;
}

Included with your ldc install is an importc.h that you’ll need to include to macro away some constructs D doesn’t understand.

You can then build as so:

$ clang -E foo.c -o foo.i -include  $LDC_INSTALL/import/importc.h
$ ldc2 foo.i
$ ./foo

Which prints hello.

Thanks for all tips.

I already use calng -E.

try linux also get error:

/usr/include/inttypes.h(297): Error: found `__nptr` when expecting `,`
/usr/include/inttypes.h(297): Error: no type-specifier for parameter
/usr/include/inttypes.h(298): Error: found `__endptr` when expecting `,`
/usr/include/inttypes.h(298): Error: no type-specifier for parameter
/usr/include/inttypes.h(301): Error: found `__nptr` when expecting `,`
/usr/include/inttypes.h(301): Error: no type-specifier for parameter
/usr/include/inttypes.h(302): Error: found `__endptr` when expecting `,`
/usr/include/inttypes.h(302): Error: no type-specifier for parameter
/usr/include/inttypes.h(305): Error: found `__nptr` when expecting `,`
/usr/include/inttypes.h(305): Error: no type-specifier for parameter
/usr/include/inttypes.h(306): Error: found `__endptr` when expecting `,`
/usr/include/inttypes.h(306): Error: no type-specifier for parameter
/usr/include/inttypes.h(310): Error: found `__nptr` when expecting `,`
/usr/include/inttypes.h(310): Error: no type-specifier for parameter
/usr/include/inttypes.h(311): Error: found `__endptr` when expecting `,`
/usr/include/inttypes.h(311): Error: no type-specifier for parameter
/usr/include/stdio.h(176): Error: missing comma or semicolon after declaration of `tmpfile`, found `__asm__` instead
/usr/include/stdio.h(257): Error: found `__filename` when expecting `,`
/usr/include/stdio.h(257): Error: no type-specifier for parameter
/usr/include/stdio.h(257): Error: found `__modes` when expecting `,`
March 16, 2023

On Thursday, 16 March 2023 at 06:05:53 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

A few potential bug reports:

https://issues.dlang.org/show_bug.cgi?id=22161
https://issues.dlang.org/show_bug.cgi?id=23725
https://issues.dlang.org/show_bug.cgi?id=22722

It may also be required if we want out of the box support on Windows, as the mingw headers also use inline assembly (which errors out).

this seems like silly bug. (after clang -E)

/src/pcache.h(25): Error: struct `test.PgHdr` conflicts with alias `test.PgHdr` at /pcache.h(18)
typedef struct PgHdr PgHdr;
struct PgHdr {
   // body
}