[Issue 22033] New: importC: Add C++ helper function to return Type for given Identifier or string

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 17 16:36:34 UTC 2021


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

          Issue ID: 22033
           Summary: importC: Add C++ helper function to return Type for
                    given Identifier or string
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

For example, GCC provides the "C" wchar_t type as a macro, which could be
defined as "int", or "short unsigned int", or "long int", or "long unsigned
int", etc...

As DMD now has the ability to parse C types, it would be great to expose this
from CParser to convert these strings to get D Types.

e.g:
---
Type *ctype = CParser::getType("short unsigned int");
assert(ctype->ty == TY::Tuns16);

--


More information about the Digitalmars-d-bugs mailing list