Bug 23808 – #include <stdlib.h> is not working with importc
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2023-03-24T13:40:42Z
Last change time
2023-03-25T22:54:51Z
Keywords
pull
Assigned to
No Owner
Creator
Temtaime
Comments
Comment #0 by temtaime — 2023-03-24T13:40:42Z
Just try this line
#include <stdlib.h>
And there's tons of:
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(58,35): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(58,43): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(65,36): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(65,44): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(94,35): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(94,43): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(100,36): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(100,44): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(118,35): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(118,43): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(125,35): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(125,43): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(132,35): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(132,43): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(140,35): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(140,43): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(153,35): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(153,43): Error: no type for declarator before `)`
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(160,35): Error: extended-decl-modifier expected
C:\workshop\tools\compiler\msvc\include\corecrt_malloc.h(160,43): Error: no type for declarator before `)`
Comment #1 by temtaime — 2023-03-24T13:48:21Z
Dustmited:
__declspec(restrict)
void* foo(void*);
Comment #2 by dlang-bot — 2023-03-24T17:47:42Z
@Temtaime created dlang/dmd pull request #15034 "Fix Issue 23808 - #include <stdlib.h> is not working with importc" fixing this issue:
- Fix Issue 23808 - #include <stdlib.h> is not working with importc
https://github.com/dlang/dmd/pull/15034
dlang/dmd pull request #15034 "Fix Issue 23808 - #include <stdlib.h> is not working with importc" was merged into master:
- 50bfcb858b302cf886982ac386bbda2e2ace11c6 by Temtaime:
Fix Issue 23808 - #include <stdlib.h> is not working with importc
https://github.com/dlang/dmd/pull/15034