Re: GLib plans for next cycle
- From: Alexander Larsson <alexl redhat com>
- To: Behdad Esfahbod <behdad behdad org>
- Cc: Ryan Lortie <desrt desrt ca>, gtk-devel-list gnome org
- Subject: Re: GLib plans for next cycle
- Date: Tue, 06 Sep 2011 17:02:38 +0200
On Tue, 2011-09-06 at 10:48 -0400, Behdad Esfahbod wrote:
> On 09/06/11 10:42, Ryan Lortie wrote:
> > On Tue, 2011-09-06 at 10:14 -0400, Behdad Esfahbod wrote:
> >> In HarfBuzz I'm using the C++ compiler without linking to libstdc++. I found
> >> it as very rewarding experience. You get library constructor/destructors for
> >> free there. I think this approach to library design has serious merit worth
> >> considering.
> >
> > Ha!
> >
> > I was just writing an email along the lines of "why don't we just
> > compile a tiny bit of C++ code"? before thinking "oh... but then we'd
> > have to link libstdc++" and closing the compose window.
>
> Yeah, the trick is to pass -fno-rtti -fno-exceptions to g++. In fact, libtool
> already has code to do this if your C compiler turns out to be a C++ compiler.
> It's the macro _LT_COMPILER_NO_RTTI. I've emailed libtool maintainers to ask
> to make this public.
This is specific to gnu g++ though. If you want to target only that then
you might as well just use the gnu c extensions to do library
constructors in plain C. I have plain C ways to implement this for most
systems, although we could use the C++ trick as a fallback.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]