diff --git a/libpgcommon/gserialized_gist.c b/libpgcommon/gserialized_gist.c
index 6ff3a81..d28643a 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("<NULLPTR>");
+
+	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 2c12bd6..72b73d3 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 6e5929b..55cebb2 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("<NULLPTR>");
-
-	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)
 {
