[cairo] Fix OS/2 build

Dave Yeo daveryeo at telus.net
Mon Nov 10 16:37:17 PST 2008

On 11/10/08 07:55 am, Doodle wrote:
> Just a note:
> Including os2.h from a library's header file might introduce problems
> sometimes.
> Imagine a case, when the library needs only INCL_PM and INCL_DOSERRORS
> parts from os2.h, so it defines those, and includes os2.h.
> Then the application includes the library's header file (thus,
> implicitly including the PM and DOSERRORS parts from os2.h), then it
> wants to include os2.h with INCL_SEMAPHORES, INCL_PM and INCL_DOSERRORS.
> However, as os2.h was already included, it won't be included again, and
> the INCL_SEMAPHORES will not take effect.

We also seem to get the same problem with including os2emx.h since by 
default os2.h includes os2emx.h. eg, the error that started this thread 
was actually caused by having

#define INCL_DOS
#include <os2.h>

in pthread.h (Yuri's port)

> That was the reason for not having os2.h includes in Cairo's public
> os2-specific header files.
> Bye,
>     Doodle
> Peter Weilbacher wrote:
>> On 10.11.2008 15:59, Behdad Esfahbod wrote:
>>> Dave Yeo wrote:
>>>> Hi, this commit,
>>>> http://gitweb.freedesktop.org/?p=cairo;a=commitdiff;h=d84752605a4aee96fa872a97a50e59a44ee7051a
>>>> broke OS/2. We now get this error,
>>>> In file included from ./cairo-os2-private.h:41:
>>>> ./cairo-os2.h:56: error: syntax error before "hps_client_window"
>>>> ./cairo-os2.h:58: warning: function declaration isn't a prototype
>>>> ./cairo-os2.h:62: error: syntax error before "HWND"
>>>> ./cairo-os2.h:62: warning: function declaration isn't a prototype
>>>> ./cairo-os2.h:72: error: syntax error before "HPS"
>>>> The problem is that these are all defined in os2*.h. Simplest fix seems
>>>> to be
>>> Then the correct fix is to include os2*.h in cairo-os2.h.
>> Agreed, then one can also remove the seperate os2.h include from
>> cairo-os2-surface.c. Let me try to test and push the fix tonight.
>> Hmm, why do we actually include os2emx.h and not os2.h for GCC?
>>     Peter.


More information about the cairo mailing list