From: Ethan A M. <merritt@u.washington.edu> - 2006-08-04 04:45:58
|
On Thursday 03 August 2006 12:56 pm, Daniel J Sebald wrote: > > if (!strstrt(GPVAL_COMPILE_OPTIONS,"-IMAGE")) load "image.dem" > No, that would mean not "way backward" compatible because "image.dem" > would still be run on older versions of gnuplot... Not a problem. Here's a variant that checks for version compatibility: if (GPVAL_VERSION == 4.1 && strstrt(GPVAL_COMPILE_OPTIONS,"+IMAGE")) \ load 'image.dem' Of course, this requires that string variables are configure in (now the default). But it you want it even more foolproof then use if (defined(GPVAL_COMPILE_OPTIONS)) \ if (GPVAL_VERSION == 4.1 && strstrt(GPVAL_COMPILE_OPTIONS,"+IMAGE")) \ load 'image.dem' That is safe even in the absence of string variables (although it doesn't actually run the demo). I've put such on SourceForge. Please have a look. It's pretty non-intrusive (all it does is add a new GPVAL_*** variable), and it will allow us to protect all the configuration-dependent demos in all.dem that are run by "make check". -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |