Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ISSUE-10] Implemented propagation of pg sphere version.#23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vitcpp merged 1 commit intopostgrespro:masterfromvitcpp:10-pgsphere-version
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletionsMakefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,9 @@ TESTS = init_test tables points euler circle line ellipse poly path box in
contains_ops contains_ops_compat bounding_box_gist gnomo healpix \
moc mocautocast epochprop

PG_CFLAGS+= -DPGSPHERE_VERSION=$(PGSPHERE_VERSION)
PG_CPPFLAGS+= -DPGSPHERE_VERSION=$(PGSPHERE_VERSION)

ifndef CXXFLAGS
# no support for CXXFLAGS in PGXS before v11
CXXFLAGS = -Wall -Wpointer-arith -Wendif-labels \
Expand Down
6 changes: 6 additions & 0 deletionsexpected/init.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,3 +3,9 @@
-- does not depend on contents of pg_sphere.sql.
--
CREATE EXTENSION pg_sphere;
select pg_sphere_version();
pg_sphere_version
-------------------
1.2.1
(1 row)

2 changes: 2 additions & 0 deletionssql/init.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,3 +3,5 @@
-- does not depend on contents of pg_sphere.sql.
--
CREATE EXTENSION pg_sphere;

select pg_sphere_version();
14 changes: 11 additions & 3 deletionssrc/output.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
#include "types.h"

#if !defined(PGSPHERE_VERSION)
#error "PGSPHERE_VERSION macro is not set"
#endif

#define PGSPHERE_STRINGIFY_INTERNAL(x) #x
#define PGSPHERE_STRINGIFY(x) PGSPHERE_STRINGIFY_INTERNAL(x)

/* Output functions */


Expand DownExpand Up@@ -527,7 +534,8 @@ spherebox_out(PG_FUNCTION_ARGS)
Datum
pg_sphere_version(PG_FUNCTION_ARGS)
{
char *buffer = (char *) palloc(20);
sprintf(buffer, "1.1.5");
PG_RETURN_CSTRING(buffer);
const char*s = PGSPHERE_STRINGIFY(PGSPHERE_VERSION);
char*p = (char *)palloc(strlen(s) + 1);
strcpy(p, s);
PG_RETURN_CSTRING(p);
}

[8]ページ先頭

©2009-2025 Movatter.jp