File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ TESTS = init_test tables points euler circle line ellipse poly path box in
3232 contains_ops contains_ops_compat bounding_box_gist gnomo healpix \
3333 moc mocautocast epochprop
3434
35+ PG_CFLAGS += -DPGSPHERE_VERSION=$(PGSPHERE_VERSION )
36+ PG_CPPFLAGS += -DPGSPHERE_VERSION=$(PGSPHERE_VERSION )
37+
3538ifndef CXXFLAGS
3639# no support for CXXFLAGS in PGXS before v11
3740CXXFLAGS = -Wall -Wpointer-arith -Wendif-labels \
Original file line number Diff line number Diff line change 33-- does not depend on contents of pg_sphere.sql.
44--
55CREATE EXTENSION pg_sphere;
6+ select pg_sphere_version();
7+ pg_sphere_version
8+ -------------------
9+ 1.2.1
10+ (1 row)
11+
Original file line number Diff line number Diff line change 33-- does not depend on contents of pg_sphere.sql.
44--
55CREATE EXTENSION pg_sphere;
6+
7+ select pg_sphere_version();
Original file line number Diff line number Diff line change 11#include "types.h"
22
3+ #if !defined(PGSPHERE_VERSION )
4+ #error "PGSPHERE_VERSION macro is not set"
5+ #endif
6+
7+ #define PGSPHERE_STRINGIFY_INTERNAL (x ) #x
8+ #define PGSPHERE_STRINGIFY (x ) PGSPHERE_STRINGIFY_INTERNAL(x)
9+
310/* Output functions */
411
512
@@ -527,7 +534,8 @@ spherebox_out(PG_FUNCTION_ARGS)
527534Datum
528535pg_sphere_version (PG_FUNCTION_ARGS )
529536{
530- char * buffer = (char * ) palloc (20 );
531- sprintf (buffer , "1.1.5" );
532- PG_RETURN_CSTRING (buffer );
537+ const char * s = PGSPHERE_STRINGIFY (PGSPHERE_VERSION );
538+ char * p = (char * )palloc (strlen (s ) + 1 );
539+ strcpy (p , s );
540+ PG_RETURN_CSTRING (p );
533541}
You can’t perform that action at this time.
0 commit comments