[GSoC] Header Generation for C/C++

Manu turkeyman at gmail.com
Wed Jul 17 22:08:04 UTC 2019


On Wed, Jul 17, 2019 at 11:55 AM Eduard Staniloiu via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Wednesday, 17 July 2019 at 18:00:38 UTC, Manu wrote:
> > On Wed, Jul 17, 2019 at 7:29 AM Iain Buclaw via Digitalmars-d
> > <digitalmars-d at puremagic.com> wrote:
> >>
> >> On Wed, 17 Jul 2019 at 15:40, Eduard Staniloiu via
> >> Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> >> >
> >> >
> >> > I have the following question: Can we use C++11 or would
> >> > that break GDC / LDC? With C++11 we could use `enum class`
> >> > which would solve this nicely. The issue with `enum class`
> >> > is that it will break code since not the fields need to be
> >> > prefixed with the enum name.
> >> >
> >> > But still, what do you think? What are the pros and cons of
> >> > supporting/using C++11?
> >> >
> >>
> >> No you cannot use C++11, yes it will break GDC bootstrap.
> >
> > This needs to be optional. I can't NOT use C++11 for
> > instance... We could read the --extern-std flag to drive the
> > output perhaps?
>
> We could use `#if __cplusplus < 201103L` to emit for C++98 and
> C++11, but I was hoping we could avoid that.
>
> I guess it will come to inserting a bunch of `#if`s

No, that doesn't work, because then code written against the header
needs to be adapted according to the -std used to compile.
I think it would be fine to use the -extern-std supplied to DMD to
drive the output that way.


More information about the Digitalmars-d mailing list