digitalmars.D - try importC on macOS, get this error
- d007 (23/23) Mar 15 2023 try with lastest ldc:
- Richard (Rikki) Andrew Cattermole (6/6) Mar 15 2023 A few potential bug reports:
- d007 (13/20) Mar 16 2023 this seems like silly bug. (after clang -E)
- Dave P. (20/22) Mar 15 2023 ldc2 does not run the c-preprocessor yet. See the below for an
- d007 (45/70) Mar 16 2023 Thanks for all tips.
try with lastest ldc: ```sh /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/in lude/_stdio.h(137): Error: found `_close` when expecting `)` /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/in lude/_stdio.h(137): Error: `;` or `,` expected /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/in lude/_stdio.h(138): Error: found `_read` when expecting `)` /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/in lude/_stdio.h(138): Error: `;` or `,` expected /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/in lude/_stdio.h(139): Error: found `_seek` when expecting `)` /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/in lude/_stdio.h(139): Error: `;` or `,` expected /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/in lude/_stdio.h(140): Error: found `_write` when expecting `)` /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/in lude/_stdio.h(140): Error: `;` or `,` expected /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/i clude/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/i clude/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/i clude/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/i clude/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/i clude/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/i clude/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/i clude/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/ ys/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/ ys/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/incl de/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/incl de/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/incl de/sys/wait.h(251): Error: missing comma or semicolon after declaration of `waitid`, found `__asm` instead ```
Mar 15 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).
Mar 15 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) ```sh /src/pcache.h(25): Error: struct `test.PgHdr` conflicts with alias `test.PgHdr` at /pcache.h(18) ``` ```c typedef struct PgHdr PgHdr; struct PgHdr { // body } ```
Mar 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: ```C // 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: ```sh $ clang -E foo.c -o foo.i -include $LDC_INSTALL/import/importc.h $ ldc2 foo.i $ ./foo ``` Which prints `hello`.
Mar 15 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:Thanks for all tips. I already use calng -E. try linux also get error: ```sh /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 `,` ```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: ```C // 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: ```sh $ clang -E foo.c -o foo.i -include $LDC_INSTALL/import/importc.h $ ldc2 foo.i $ ./foo ``` Which prints `hello`.
Mar 16 2023