tarantool / gis

A full-featured geospatial extension for Tarantool
Other
49 stars 5 forks source link

Fix "missing declaration for symbol ''pj_get_errno''" #12

Closed rtsisyk closed 5 years ago

rtsisyk commented 5 years ago

Closes #11

Totktonada commented 5 years ago

As I see the reason of the problem is the typo in pj_get_errno_ref() function name and it can be fixed in this way:

diff --git a/gis/projection.lua b/gis/projection.lua
index c11729e..1bd184f 100644
--- a/gis/projection.lua
+++ b/gis/projection.lua
@@ -41,7 +41,7 @@ projections.PROJ_VERSION = PROJ_VERSION

 local function ctx_raise()
     -- local errno = lib.pj_ctx_get_errno(ctx)
-    local errno = lib.pj_get_errno(ctx)
+    local errno = lib.pj_get_errno_ref()[0]
     error('PROJ: '..ffi.string(lib.pj_strerrno(errno)))
 end

@rtsisyk Can you please explain why do you choose to use pj_ctx_alloc() and related functions? Is thread safety matters in case of tarantool?

rtsisyk commented 5 years ago

@rtsisyk Can you please explain why do you choose to use pj_ctx_alloc() and related functions? Is thread safety matters in case of tarantool?

Because other API was marked as deprecated.

Totktonada commented 5 years ago

Because other API was marked as deprecated.

The whole proj_api.h is now deprecated. Anyway, both variants work, so I don't have objections.