[cairo] static inline C code in VC++
cairo at antoineazar.com
Sat Jan 19 16:30:05 PST 2008
At 07:28 PM 1/18/2008, Behdad Esfahbod wrote:
>On Fri, 2008-01-18 at 16:10 -0500, Antoine Azar wrote:
> > Good catch. I'm not sure what's the desired software architecture, but
> > cairo-boilerplate.c includes cairo-types-private.h which proudly
> > announces:
> > /* This is the only header file not including cairoint.h. It only
> > contains
> > * typedefs.*/
> > #include "cairo.h"
> > #include "cairo-fixed-private.h"
> > Including cairoint.h in cairo-fixed-private.h results in a bunch of
> > hard to trace errors, in addition to not respecting the comment
> > above.
> > We could include cairoint.h in every file (cairo-boilerplate.c,
> > cairo-boilerplate-ps.c, cairo-boilerplate-svg.c, etc) that might
> > include cairo-fixed-private.h (and then any other file using inline
> > but not already including cairoint.h), but that's really ugly. Maybe
> > we should move these platform dependant #define to some other header
> > file? seems like they're not really related to the rest of cairoint.h
> > anyway.
>Then the static inline prototypes need to move out of that file.
>Possibly into cairoint.h. Which prototypes are we talking about?
the static inline functions are probably at the right place, we're
talking about functions like _cairo_fixed_from_int,
_cairo_fixed_from_double, etc, in cairo-fixed-private.h.
Isn't it better to move the platform dependant defines to another
file than cairoint.h, and include that file in cairoint.h and
wherever else it's needed?
> > Antoine
> > At 03:44 PM 1/18/2008, Carl Worth wrote:
> > > On Fri, 18 Jan 2008 12:31:37 -0800, Vladimir Vukicevic wrote:
> > > > Hm, at some point there was something like
> > > > #ifdef _MSC_VER
> > > > #define inline __inline
> > > > #endif
> > >
> > > I still see this in cairoint.h:
> > >
> > > #ifdef _MSC_VER
> > > #define snprintf _snprintf
> > > #undef inline
> > > #define inline __inline
> > > #endif
> > >
> > > Is something just failing to include that somewhere?
> > >
> > > -Carl
> > >
> > _______________________________________________
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
>"Those who would give up Essential Liberty to purchase a little
> Temporary Safety, deserve neither Liberty nor Safety."
> -- Benjamin Franklin, 1759
More information about the cairo