[Issue 15587] New: Enable use of D keywords as identifiers when interfacing to C/C++
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Wed Jan 20 12:06:54 PST 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15587
          Issue ID: 15587
           Summary: Enable use of D keywords as identifiers when
                    interfacing to C/C++
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com
Consider:
    extern (C) int* with();
where delegate is a C function name. This, of course, fails because 'with' is a
D keyword. A solution is:
    extern (C) int* with_();
and have the C/C++ name mangler remove any trailing _ from identifiers.
The prefix version, _with, has problems because it would be impossible to have
a C identifier named '_traits' or '_gshared'.
--
    
    
More information about the Digitalmars-d-bugs
mailing list