From: <ai...@us...> - 2013-11-27 18:16:38
|
Revision: 12770 http://sourceforge.net/p/plplot/code/12770 Author: airwin Date: 2013-11-27 18:16:31 +0000 (Wed, 27 Nov 2013) Log Message: ----------- Solve recently introduced build issue for the majority of Debian-based distribution users who are still using an ancient version of shapelib. If the HAVE_SAHOOKS macro is not defined (always in the present case because I haven't yet created the test to #define HAVE_SAHOOKS) drop back to using SHPOpen with no SAHooks argument) rather than SHPOpenLL. Tested by Alan W. Irwin <ai...@us...> on Linux by building and running (using valgrind) standard C example 19, which produced good results (completely clean valgrind run and good plots) along with the misleading but expected Unable to open usaglobe.shp or usaglobe.SHP. Unable to open usaglobe.shp or usaglobe.SHP. Unable to open globe.shp or globe.SHP. Unable to open globe.shp or globe.SHP. messages from SHPOpen. ToDo: implement a CMake-based test that will #define the HAVE_SAHOOKS C macro (or not) for plmap.c. This will get rid of the above misleading messages if the shapelib library is modern enough to include SAHooks. Modified Paths: -------------- trunk/src/plmap.c Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2013-11-27 15:37:50 UTC (rev 12769) +++ trunk/src/plmap.c 2013-11-27 18:16:31 UTC (rev 12770) @@ -487,10 +487,18 @@ { SHPHandle file; char *fs = NULL, *dn = NULL; +#ifdef HAVE_SAHOOKS SAHooks sHooks; SASetupDefaultHooks( &sHooks ); sHooks.Error = CustomErrors; +#else + // Using ancient version of shapelib without SAHooks or SHPOpenLL. + // For this case live with the misleading "Unable to open" error + // messages. + int sHooks; +#define SHPOpenLL(a, b, c) SHPOpen(a, b) +#endif //*** search build tree *** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |