digitalmars.D - Why doesn't the D compiler include the C preprocessor for importC?
- Ki Rill (2/2) Jan 18 I am genuinely curious about this. What are the arguments against
- Richard (Rikki) Andrew Cattermole (3/3) Jan 18 The only one that matters: licensing.
- Dave P. (6/8) Jan 18 The main reason is that other compilers/platforms define a huge
- Walter Bright (7/14) Jan 20 You're right. It's (surprisingly) not that those preprocessors implement...
I am genuinely curious about this. What are the arguments against it?
Jan 18
The only one that matters: licensing. Although once mature I'm sure we can simplify the situation somewhat as part of the Windows installer.
Jan 18
On Thursday, 19 January 2023 at 05:04:11 UTC, Ki Rill wrote:I am genuinely curious about this. What are the arguments against it?The main reason is that other compilers/platforms define a huge number of macros and extensions that real header files depend on. There is already a C preprocessor written in D (https://github.com/walterbright/warp) that could be used, but there’s an endless parade of predefined macros.
Jan 18
On 1/18/2023 9:49 PM, Dave P. wrote:On Thursday, 19 January 2023 at 05:04:11 UTC, Ki Rill wrote:You're right. It's (surprisingly) not that those preprocessors implement extensions. It's that they predefine several hundred macros, many of them being dependent on various switches. The documentation on it is weak to wrong to nonexistent, so one is faced with quite a problem trying to duplicate it. And then, of course, the behavior will change on the next release. It's like chasing a rainbow.I am genuinely curious about this. What are the arguments against it?The main reason is that other compilers/platforms define a huge number of macros and extensions that real header files depend on. There is already a C preprocessor written in D (https://github.com/walterbright/warp) that could be used, but there’s an endless parade of predefined macros.
Jan 20