Re: Plans for 1.3/1.4
- From: richard offer <offer sirius com>
- To: gtk-devel-list redhat com
- Subject: Re: Plans for 1.3/1.4
- Date: Mon, 01 Mar 1999 08:50:21 -0800
> from 'pavel@atrey.karlin.mff.cuni.cz' on 'Mar 01 11:17 +0100' | sed
'1,s/^/> /'
>
>Hi!
>
>> > 4) Integration of Tor Lillqvist's Win32 port.
>>
>>
>> Would it be cleaner (more orthogonal) to use something like
>> #if GDK_WINDOWING_API == GDK_WINDOWING_API_X11
>> #elif GDK_WINDOWING_API == GDK_WINDOWING_API_WIN32
>> #elif GDK_WINDOWING_API == GDK_WINDOWING_API_BEOS
>>
>> etc? (Or is that too verbose?) (There is not much code in gtk+/gtk
>> that needs conditional compilation.)
>
>I would prefer
> if (GDK_API() == GDK_X11) {
> }
>
>or
> switch (GDK_API()) {
> case GDK_X11:
> ...
> }
>
>, where GDK_API() is either macro hardcoded to specific value
>
>(i.e. #define GDK_API() GDK_X11)
>
>*or* real function. gcc can optimize it out, anyway, it is much
>cleaner, and - we'll need gtk runnable over multiple gdk's in future.
>
>(Think about gtk runable over gdk.cursed or gdk.X11 at some time. The
>same might have sense for gdk.beos and gdk.X11 - assuming that BeOS
>has working X11 port.)
Please don't do this, it will make it easier all round if its #ifdef
rather than if.
By making it 'if' based requires valid C syntax in each part of the
conditional #ifdef doesn't (and you can use it for #includes). ANDF
tried to make everything doable at run-time (no conditional
compilation), and eventually you find out that it only works for
simple cases---but by then its too late.
>
> Pavel
richard.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]