[cairo] Re: Linking to Cairo 1.0.2 statically (Win32)

Bill Spitzak spitzak at d2.com
Fri Oct 14 12:38:01 PDT 2005


The problem with some kind of library_init() function is that 
programmers will fail to call it, or call it multiple times, or call it 
in parallel threads. It solves nothing. It also means that anybody 
writing any kind of wrapper has to make an init() function, unless they 
themselves solve this very problem so that they can make it call it in a 
thread-safe manner. This should be solved at the lowest level.

I see nothing wrong with using platform-specific code when the very 
objects being protected are platform-specific Windows mutexes.

Vladimir Vukicevic wrote:
> I still don't see what the problem is with just adding a
> cairo_win32_surface_init() function.  Heck, it would be negligible
> overhead to initialize if not initialized in
> cairo_win32_surface_create().  Some people dislike writing init
> functions, I personally dislike "magic" things happening behind my
> back... static C++ constructors in C code definitely fits into that
> category.


More information about the cairo mailing list