From: Sandro Santilli Date: Thu, 19 Aug 2004 06:15:58 +0000 (+0000) Subject: USE_VERSION gets 80 where it got 75 X-Git-Tag: pgis_0_9_1~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b1c66bc6d0fd1168ed09f2d9489fd54a5343700;p=postgis USE_VERSION gets 80 where it got 75 git-svn-id: http://svn.osgeo.org/postgis/trunk@687 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/Makefile b/Makefile index 874784d4b..84e0f1000 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ else ifneq ($(findstring 7.4,$(VERSION)),) USE_VERSION=74 else - USE_VERSION=75 + USE_VERSION=80 endif endif endif diff --git a/lwgeom/Makefile b/lwgeom/Makefile index 1a0579d7a..c4ed2c894 100644 --- a/lwgeom/Makefile +++ b/lwgeom/Makefile @@ -70,7 +70,7 @@ else ifneq ($(findstring 7.4,$(VERSION)),) USE_VERSION=74 else - USE_VERSION=75 + USE_VERSION=80 endif endif endif diff --git a/lwgeom/lwgeom_gist.c b/lwgeom/lwgeom_gist.c index 128f54d77..e48b1cbf9 100644 --- a/lwgeom/lwgeom_gist.c +++ b/lwgeom/lwgeom_gist.c @@ -529,7 +529,7 @@ Datum gist_rtree_decompress(PG_FUNCTION_ARGS) PG_FUNCTION_INFO_V1(lwgeom_box_union); Datum lwgeom_box_union(PG_FUNCTION_ARGS) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 bytea *entryvec = (bytea *) PG_GETARG_POINTER(0); #else GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); @@ -544,7 +544,7 @@ Datum lwgeom_box_union(PG_FUNCTION_ARGS) elog(NOTICE,"GIST: lwgeom_box_union called\n"); #endif -#if USE_VERSION < 75 +#if USE_VERSION < 80 numranges = (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY); cur = (BOX2DFLOAT4 *) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[0].key); #else @@ -559,7 +559,7 @@ Datum lwgeom_box_union(PG_FUNCTION_ARGS) for (i = 1; i < numranges; i++) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[i].key); #else cur = (BOX2DFLOAT4*) DatumGetPointer(entryvec->vector[i].key); @@ -746,7 +746,7 @@ Datum lwgeom_gbox_same(PG_FUNCTION_ARGS) PG_FUNCTION_INFO_V1(lwgeom_gbox_picksplit); Datum lwgeom_gbox_picksplit(PG_FUNCTION_ARGS) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 bytea *entryvec = (bytea *) PG_GETARG_POINTER(0); #else GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); @@ -782,7 +782,7 @@ Datum lwgeom_gbox_picksplit(PG_FUNCTION_ARGS) posL = posR = posB = posT = 0; -#if USE_VERSION < 75 +#if USE_VERSION < 80 maxoff = ((VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY)) - 1; cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[FirstOffsetNumber].key); #else @@ -800,7 +800,7 @@ elog(NOTICE," cur is: <%.16g %.16g,%.16g %.16g>", cur->xmin, cur->ymin, cur->x /* find MBR */ for (i = OffsetNumberNext(FirstOffsetNumber); i <= maxoff; i = OffsetNumberNext(i)) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[i].key); #else cur = (BOX2DFLOAT4 *) DatumGetPointer(entryvec->vector[i].key); @@ -840,7 +840,7 @@ elog(NOTICE," pageunion is: <%.16g %.16g,%.16g %.16g>", pageunion.xmin, pageun #ifdef DEBUG_GIST6 elog(NOTICE," AllIsEqual!"); #endif -#if USE_VERSION < 75 +#if USE_VERSION < 80 cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[OffsetNumberNext(FirstOffsetNumber)].key); #else cur = (BOX2DFLOAT4*) DatumGetPointer(entryvec->vector[OffsetNumberNext(FirstOffsetNumber)].key); @@ -898,7 +898,7 @@ elog(NOTICE," AllIsEqual!"); for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[i].key); #else cur = (BOX2DFLOAT4*) DatumGetPointer(entryvec->vector[i].key); @@ -927,7 +927,7 @@ elog(NOTICE," unionB is: <%.16g %.16g,%.16g %.16g>", unionB->xmin, unionB->ymi KBsort *arr = (KBsort*)palloc( sizeof(KBsort) * maxoff ); posL = posR = posB = posT = 0; for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 arr[i-1].key = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[i].key); #else arr[i-1].key = (BOX2DFLOAT4*) DatumGetPointer(entryvec->vector[i].key); diff --git a/postgis.h b/postgis.h index 425e8a4ff..efe296299 100644 --- a/postgis.h +++ b/postgis.h @@ -11,6 +11,9 @@ * ********************************************************************** * $Log$ + * Revision 1.50 2004/08/19 06:15:58 strk + * USE_VERSION gets 80 where it got 75 + * * Revision 1.49 2004/07/28 13:37:43 strk * Added postgis_uses_stats and postgis_scripts_version. * Experimented with PIP short-circuit in within/contains functions. @@ -650,7 +653,7 @@ Datum geometry2box(PG_FUNCTION_ARGS); Datum explode_histogram2d(PG_FUNCTION_ARGS); Datum estimate_histogram2d(PG_FUNCTION_ARGS); -#if USE_VERSION >= 75 +#if USE_VERSION >= 80 Datum geometry_analyze(PG_FUNCTION_ARGS); #endif diff --git a/postgis.sql.in b/postgis.sql.in index 5b67830a2..2ec6cdbac 100644 --- a/postgis.sql.in +++ b/postgis.sql.in @@ -214,7 +214,7 @@ CREATEFUNCTION geometry_out(GEOMETRY_IN_REP) AS '@MODULE_FILENAME@' LANGUAGE 'C' WITH (isstrict); -#if USE_VERSION >= 75 +#if USE_VERSION >= 80 CREATEFUNCTION geometry_analyze(internal) RETURNS bool AS '@MODULE_FILENAME@' @@ -226,7 +226,7 @@ CREATE TYPE geometry ( internallength = variable, input = geometry_in, output = geometry_out, -#if USE_VERSION >= 75 +#if USE_VERSION >= 80 analyze = geometry_analyze, #endif storage = main @@ -281,7 +281,7 @@ CREATE TABLE geometry_columns ( coord_dimension integer not null, srid integer not null, type varchar(30) not null, -#if USE_VERSION < 75 +#if USE_VERSION < 80 attrelid oid, varattnum int, stats histogram2d, @@ -438,10 +438,10 @@ SELECT ''rename_geometry_table_constraint() is obsoleted''::text -- (for PG>=73) -- -- o link records to system tables through attrelid and varattnum --- (for PG<75) +-- (for PG<80) -- -- o delete all records for which no linking was possible --- (for PG<75) +-- (for PG<80) -- -- ----------------------------------------------------------------------- @@ -500,7 +500,7 @@ BEGIN GET DIAGNOSTICS foundschema = ROW_COUNT; #endif -#if USE_VERSION >= 75 +#if USE_VERSION >= 80 -- no linkage to system table needed return ''fixed:''||foundschema::text; #endif @@ -608,7 +608,7 @@ BEGIN strpos(typecheck.consrc, ''::'')- strpos(typecheck.consrc, ''='') ))::varchar as type, -#if USE_VERSION < 75 +#if USE_VERSION < 80 a.attrelid, a.attnum as varattnum, null::histogram2d as stats @@ -2586,17 +2586,17 @@ LANGUAGE 'sql' WITH (isstrict); -- UPDATE_GEOMETRY_STATS() ----------------------------------------------------------------------- -- --- Only meaningful for PG<75. +-- Only meaningful for PG<80. -- Gather statisticts about geometry columns for use -- with cost estimator. -- --- It is defined also for PG>=75 for back-compatibility +-- It is defined also for PG>=80 for back-compatibility -- ----------------------------------------------------------------------- -#if USE_VERSION >= 75 +#if USE_VERSION >= 80 CREATEFUNCTION update_geometry_stats() RETURNS text AS ' SELECT ''update_geometry_stats() has been obsoleted. Statistics are automatically built running the ANALYZE command''::text' LANGUAGE 'sql'; -#else // USE_VERSION < 75 +#else // USE_VERSION < 80 CREATEFUNCTION update_geometry_stats() RETURNS text AS @@ -2636,20 +2636,20 @@ BEGIN END; ' LANGUAGE 'plpgsql' ; -#endif // USE_VERSION < 75 +#endif // USE_VERSION < 80 ----------------------------------------------------------------------- -- UPDATE_GEOMETRY_STATS( , ) ----------------------------------------------------------------------- -- --- Only meaningful for PG<75. +-- Only meaningful for PG<80. -- Gather statisticts about a geometry column for use -- with cost estimator. -- --- It is defined also for PG>=75 for back-compatibility +-- It is defined also for PG>=80 for back-compatibility -- ----------------------------------------------------------------------- -#if USE_VERSION >= 75 +#if USE_VERSION >= 80 CREATEFUNCTION update_geometry_stats(varchar,varchar) RETURNS text AS 'SELECT update_geometry_stats();' LANGUAGE 'sql' ; #else @@ -2702,7 +2702,7 @@ END; ' LANGUAGE 'plpgsql' ; -#endif // USE_VERSION < 75 +#endif // USE_VERSION < 80 ----------------------------------------------------------------------- -- CREATE_HISTOGRAM2D( , ) diff --git a/postgis_estimate.c b/postgis_estimate.c index 47c075ee6..e124880d4 100644 --- a/postgis_estimate.c +++ b/postgis_estimate.c @@ -11,6 +11,9 @@ * ********************************************************************** * $Log$ + * Revision 1.31 2004/08/19 06:15:58 strk + * USE_VERSION gets 80 where it got 75 + * * Revision 1.30 2004/08/16 11:03:25 mcayland * Added DLLIMPORT reference to "default_statistics_target" if we are compiling under Win32. This should make it unnecessary to apply Romi's patch to the PostgreSQL source tree when compiling PostgreSQL ready for PostGIS. * @@ -160,7 +163,7 @@ #include "executor/spi.h" -#if USE_VERSION >= 75 +#if USE_VERSION >= 80 #include "commands/vacuum.h" @@ -652,7 +655,7 @@ Datum build_histogram2d(PG_FUNCTION_ARGS) -#if USE_VERSION < 75 +#if USE_VERSION < 80 /* * get_restriction_var * Examine the args of a restriction clause to see if it's of the @@ -1008,7 +1011,7 @@ postgisgistcostestimate(PG_FUNCTION_ARGS) PG_RETURN_VOID(); } -#else // USE_VERSION >= 75 +#else // USE_VERSION >= 80 /* * This function returns an estimate of the selectivity diff --git a/postgis_gist_72.c b/postgis_gist_72.c index 97ded5c55..2307e9bae 100644 --- a/postgis_gist_72.c +++ b/postgis_gist_72.c @@ -11,6 +11,9 @@ * ********************************************************************** * $Log$ + * Revision 1.19 2004/08/19 06:15:58 strk + * USE_VERSION gets 80 where it got 75 + * * Revision 1.18 2004/06/09 10:19:06 strk * Moved changes needed for PG75 inside postgis_gist_72.c using #if switches. * @@ -339,7 +342,7 @@ Datum rtree_decompress(PG_FUNCTION_ARGS) PG_FUNCTION_INFO_V1(gbox_union); Datum gbox_union(PG_FUNCTION_ARGS) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 bytea *entryvec = (bytea *) PG_GETARG_POINTER(0); #else GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); @@ -355,7 +358,7 @@ Datum gbox_union(PG_FUNCTION_ARGS) fflush( stdout ); #endif -#if USE_VERSION < 75 +#if USE_VERSION < 80 numranges = (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY); cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[0].key); #else @@ -367,7 +370,7 @@ Datum gbox_union(PG_FUNCTION_ARGS) for (i = 1; i < numranges; i++) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[i].key); #else cur = DatumGetBoxP(entryvec->vector[i].key); @@ -438,7 +441,7 @@ PG_FUNCTION_INFO_V1(gbox_picksplit); Datum gbox_picksplit(PG_FUNCTION_ARGS) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 bytea *entryvec = (bytea *) PG_GETARG_POINTER(0); #else GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); @@ -470,7 +473,7 @@ gbox_picksplit(PG_FUNCTION_ARGS) #endif posL = posR = posB = posT = 0; -#if USE_VERSION < 75 +#if USE_VERSION < 80 maxoff = ((VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY)) - 1; cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[FirstOffsetNumber].key); #else @@ -483,7 +486,7 @@ gbox_picksplit(PG_FUNCTION_ARGS) /* find MBR */ for (i = OffsetNumberNext(FirstOffsetNumber); i <= maxoff; i = OffsetNumberNext(i)) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[i].key); #else cur = DatumGetBoxP(entryvec->vector[i].key); @@ -513,7 +516,7 @@ gbox_picksplit(PG_FUNCTION_ARGS) unionR = (BOX *) palloc(sizeof(BOX)); if (allisequal) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[OffsetNumberNext(FirstOffsetNumber)].key); #else cur = DatumGetBoxP(entryvec->vector[OffsetNumberNext(FirstOffsetNumber)].key); @@ -566,7 +569,7 @@ gbox_picksplit(PG_FUNCTION_ARGS) for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[i].key); #else cur = DatumGetBoxP(entryvec->vector[i].key); @@ -587,7 +590,7 @@ gbox_picksplit(PG_FUNCTION_ARGS) KBsort *arr = (KBsort*)palloc( sizeof(KBsort) * maxoff ); posL = posR = posB = posT = 0; for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { -#if USE_VERSION < 75 +#if USE_VERSION < 80 arr[i-1].key = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[i].key); #else arr[i-1].key = DatumGetBoxP(entryvec->vector[i].key);