From: Bborie Park Date: Thu, 25 Aug 2011 18:18:20 +0000 (+0000) Subject: Fix error of unknown symbol gidx_to_string when building with the flags --with-raster... X-Git-Tag: 2.0.0alpha1~1066 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=62b39d015a7c056633c106ed702f83ceb8ffaea5;p=postgis Fix error of unknown symbol gidx_to_string when building with the flags --with-raster --enable-debug using patch gidx_to_string.patch provided by bnordgren. Associated ticket is #1161 git-svn-id: http://svn.osgeo.org/postgis/trunk@7786 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/libpgcommon/gserialized_gist.c b/libpgcommon/gserialized_gist.c index 6ff3a81e5..d28643a47 100644 --- a/libpgcommon/gserialized_gist.c +++ b/libpgcommon/gserialized_gist.c @@ -22,6 +22,32 @@ #include "gserialized_gist.h" +/* Generate human readable form for GIDX. */ +#if POSTGIS_DEBUG_LEVEL > 0 +char* gidx_to_string(GIDX *a) +{ + char *str, *rv; + int i, ndims; + + if ( a == NULL ) + return pstrdup(""); + + str = (char*)palloc(128); + rv = str; + ndims = GIDX_NDIMS(a); + + str += sprintf(str, "GIDX("); + for ( i = 0; i < ndims; i++ ) + str += sprintf(str, " %.12g", GIDX_GET_MIN(a,i)); + str += sprintf(str, ","); + for ( i = 0; i < ndims; i++ ) + str += sprintf(str, " %.12g", GIDX_GET_MAX(a,i)); + str += sprintf(str, " )"); + + return rv; +} +#endif + /** * Given a #GSERIALIZED datum, as quickly as possible (peaking into the top diff --git a/libpgcommon/gserialized_gist.h b/libpgcommon/gserialized_gist.h index 2c12bd651..72b73d323 100644 --- a/libpgcommon/gserialized_gist.h +++ b/libpgcommon/gserialized_gist.h @@ -58,6 +58,13 @@ GIDX* gidx_from_gbox(GBOX box); /* Increase the size of a GIDX */ void gidx_expand(GIDX *a, float d); + +/* Generate human readable form for GIDX. */ +#if POSTGIS_DEBUG_LEVEL > 0 +char* gidx_to_string(GIDX *a) ; +#endif + + /* Returns number of dimensions for this GIDX */ #define GIDX_NDIMS(gidx) ((VARSIZE((gidx)) - VARHDRSZ) / (2 * sizeof(float))) /* Minimum accessor. */ diff --git a/postgis/gserialized_gist_nd.c b/postgis/gserialized_gist_nd.c index 6e5929b64..55cebb2d5 100644 --- a/postgis/gserialized_gist_nd.c +++ b/postgis/gserialized_gist_nd.c @@ -78,32 +78,6 @@ Datum gserialized_within(PG_FUNCTION_ARGS); typedef bool (*gidx_predicate)(GIDX *a, GIDX *b); -/* Generate human readable form for GIDX. */ -#if POSTGIS_DEBUG_LEVEL > 0 -static char* gidx_to_string(GIDX *a) -{ - char *str, *rv; - int i, ndims; - - if ( a == NULL ) - return pstrdup(""); - - str = (char*)palloc(128); - rv = str; - ndims = GIDX_NDIMS(a); - - str += sprintf(str, "GIDX("); - for ( i = 0; i < ndims; i++ ) - str += sprintf(str, " %.12g", GIDX_GET_MIN(a,i)); - str += sprintf(str, ","); - for ( i = 0; i < ndims; i++ ) - str += sprintf(str, " %.12g", GIDX_GET_MAX(a,i)); - str += sprintf(str, " )"); - - return rv; -} -#endif - /* Allocate a new copy of GIDX */ static GIDX* gidx_copy(GIDX *b) {