[cairo] Cairo ported to OS/2 - Suggestions

Bill Spitzak spitzak at d2.com
Tue Aug 16 13:39:20 PDT 2005


I would prefer "CAIROEXPORT" over "CAIRODECLSPEC" so that it is a little 
more clear what it's purpose is. I've also found the best way to control 
the Win32 dllimport/export mess is to do this:

#ifndef CAIROEXPORT
# if _WIN32
#  define CAIROEXPORT __declspec(dllimport)
# endif
#endif

The way Cairo itself is compiled is with 
-DCAIROEXPORT=__declspec(dllexport). This avoids the need for yet 
*another* variable (such as the -DBUILD_CAIRO you show).

Have not had any experience with the calling conventions. Do all 
compilers require it to be placed between the type and the function 
name? I would think a compiler that required it before the type would 
mean your CAIROCALL would not work.

Doodle wrote:

> CAIRODECLSPEC cairo_t * CAIROCALL
> cairo_create (cairo_surface_t *target);
> 
> CAIRODECLSPEC void CAIROCALL
> cairo_destroy (cairo_t *cr);
> 
> typedef void (CAIROCALL *cairo_destroy_func_t) (void *data);


More information about the cairo mailing list