April 05, 2017 Re: Using the C preprocessor with D code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Wed, Apr 05, 2017 at 06:21:48PM -0700, Walter Bright via Digitalmars-d wrote: > On 4/5/2017 1:50 PM, H. S. Teoh via Digitalmars-d wrote: > > Who says you can't use a preprocessor with D code? ;-) > > There are some issues with it. The C preprocessor is defined to work on "preprocessor tokens", which are not quite the same thing as text. Well, yes, but since D syntax is sufficiently close to C, the difference is immaterial. :-) Mostly, anyway. I can see the preprocessor getting confused by D-specific syntax like token strings or `` literals, but for the most part if the purpose is to expand C macros into D code snippets, this mostly shouldn't matter. T -- Не дорог подарок, дорога любовь. |
Copyright © 1999-2021 by the D Language Foundation