Re: compile glib with sunpro



Havoc Pennington wrote:
> 
> Ian Britten <britten caris com> writes: 

> GLib has abstractions for various compiler-specific mechanisms
> (gint64, the inline stuff, G_GNUC_PRINTF, etc.). There's no way to
> support those without being compiler-specific.

Probably there is a way to do it, if you want to put a lot of #ifdefs.
Compilers usually #define something which can be used to identify the
compiler and version.

> Look at it this way: it's better than having lots of apps that don't
> build with Sun cc at all due to using gcc extensions without the
> abstractions. ;-)
> 
> FWIW it _probably_ works to build with Sun CC and then use gcc for
> apps, assuming gcc supports everything Sun CC does.

Note: "Sun CC" is Sun's C++ compiler. "Sun cc" is Sun's C compiler. The
following text assumes C compiler.

Yes, it works. When you do that, you still get gcc extensions in
"#ifdef __GNUC__" sections. However, if you compile glib with gcc, then
you don't get those (or at least not all of) #ifdefs. I would argue that
this is a bug, but I don't have a problem with it, so I won't write a
patch. And since it's been a known thing for quite some time, I suppose it
didn't hurt anybody else enough to write a patch.

My glib installation has some things along the line of "#ifdef __SUNPRO_C".
It works fine, regardless of the compiler one uses, just as "#ifdef __GNUC__"
things work fine.

-- 
 .-.   .-.    Are you crying?  No, I'm bleeding.
(_  \ /  _)
     |        dave arsdigita com
     |




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]