Proof of concept: automatically import C header files

Jacob Carlborg doob at me.com
Wed Jul 17 23:15:36 PDT 2013


On 2013-07-18 00:36, Walter Bright wrote:

> You could, but then you are left with failing to recognize:
>
>      #define FOO 3
>
> and converting it to:
>
>      enum FOO = 3;

And things like:

#if linux
short a;
#elif _WIN32 || _WIN64
int a;
#endif

Should preferably be converted to:

version (linux)
     short a;

else version (Windows)
     int a;

Other example:

#define foo(a, b) a + b

Should be converted to:

auto foo (A, B) (A a, B b) { return a + b; }

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list