From: Petr M. <mi...@ph...> - 2006-08-04 07:22:03
|
>>> 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' Unfortunately, this is not portable. I've just tried a windows version compiled with all of the "default" #defines in makefile&config.mgw, including IMAGE; but its "show version long" reports only: Compile options: +READLINE -LIBREADLINE +GD_PNG +GD_TTF -NOCWDRC +USE_MOUSE and thus it is not updated to options set from within config.h. Cannot the string for the "compiled options" be concanated according to #define's? --- PM |