[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: version checking
From: |
Richard Frith-Macdonald |
Subject: |
Re: version checking |
Date: |
Wed, 26 Feb 2014 11:20:10 +0000 |
On 26 Feb 2014, at 10:15, Kevin Mitchell <kevmitch@gmail.com> wrote:
> I have been experimenting with different versions of the GNUstep libraries. I
> have discovered that somewhere between gnustep-gui=0.20.0-3 (in Debian
> unstable) and 0.24.0 (the latest svn), the
> -[NSBezierPath setLineDash:(const float *)pattern count:(int)count
> phase:(float)phase]
> has been fixed to be more consistent with the apple implementation
> -[NSBezierPath setLineDash:(const CGFloat *)pattern count:(NSInteger)count
> phase:(CGFloat)phase]
>
> Previously, I succeeded in compiling code that used this method using both
> GNUStep and Cocoa with an #ifdef GNUSTEP hack. Of course, this no longer
> works for the newer gnustep version.
>
> I have tried using something like
>
> #if GS_API_VERSION(012200, GS_API_LATEST)
The above is used by the gnustep headers to control visibility of APIs
depending on what version you have declared you want (see
gnustep.org/resources/documentation/Developer/Base/Reference/index.html).
That's not what you are trying to do.
> but this doesn't seem to evaluate to false on gnustep-gui=0.20.0
>
> what is the proper way to detect and handle different gnustep versions?
You mean GUI version here ... you want to check what version of GUI you are
building against and have your code behave differently for different versions
of the GUI.
The information you need is made available within your makefile environment.
The gui.make fragment (installed when gnustep-gui was installed) will have
defined something like:
GNUSTEP_GUI_VERSION = 0.24.0
GNUSTEP_GUI_MAJOR_VERSION = 0
GNUSTEP_GUI_MINOR_VERSION = 24
GNUSTEP_GUI_SUBMINOR_VERSION = 0
These variables are available in the make files in your project;
So you can have your makefile examine the variables and add some define to the
flags used when building your code (eg define OLDBEZIERPATH)
Then in your source code you could have:
#if defined(OLDBEZIERPATH)
...
- version checking, Kevin Mitchell, 2014/02/26
- Re: version checking,
Richard Frith-Macdonald <=