emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hourglass only for X-windows?


From: Stefan Monnier
Subject: Re: Hourglass only for X-windows?
Date: Sat, 12 Mar 2005 08:41:39 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> Conditional compilation constants are not comments. They are not there to
> assist your reading of the code, they are there to enable that code
> when appropriate. For that purpose, it is actually clearer to have the
> constants named so that the conditions under which that code is
> enabled is obvious. Having hourglass code surrounded by HAVE_HOURGLASS
> is not adding anything, because the actual conditions under which
> hourglass cursors are available depend on the platform, not some
> configure test. Also someone debugging why hourglass cursors do
> not work on a Mac might miss the fact that they are only enabled on X
> and W32, that is not likely if we list the real conditions under which
> that code is enabled.

The other side of the coin is that if you add hourglass support to the
Carbon branch, you'll have to check each #ifdef HAVE_X_WINDOWS to see if it
relates to hourglass or not.

I personally like the HAVE_HOURGLASS style of coding better than the
"defined HAVE_X_WINDOWS && defined NT_GUI && ...".  But of course, an even
better approach might be to remove all those conditionals and simply always
provide all the <foo>_hourglass functions, even with an empty body
if the hourglass functionality is missing for a particular system.  It tends
to make the code more readable.



        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]