apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gisle Vanem" <g...@bgnett.no>
Subject Re: Inline problems on MingW
Date Mon, 30 Aug 2004 17:48:24 GMT
"Cliff Woolley" wrote:

> Um, why not just do this in apr.hw?
> 
> #ifndef __GNUC__
> #define APR_INLINE __inline
> #else
> #define APR_INLINE extern __inline
> #endif
> 
> Seems the cleanest way to me by far.  That is, after all, what apr.h is
> for.

Did you read and understand my 1st message? Stuff like
static APR_INLINE void copy_array_hdr_core (in apr_tables.c)

wouldn't compile. I.e. becoming "static extern __inline ..".

> > Another problem is that "extern __inline" code will *not* be inlined with
> > "gcc -O0" (__NO_INLINE__ becomes a built-in). So a gcc-built DLL must
> > use -O1 or higher unless we "sweep up" such inline functions in a src-file.
> 
> This is surely not a problem, right?  Only debug builds will use -O0, in
> which case you don't really want inlining anyway.

So how to turn off inlining? I mean functions like FileTimeToAprTime()
must be in 1 .o-file with "gcc -O0" too. One way is to put this at end of
time/win32/time.c:

#if defined(__GNUC__) && defined(__NO_INLINE__)
#undef ATIME_G
#include <apr_arch_atime.h>
#endif

Same for the other headerinliners.

--gv


Mime
View raw message