aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2017-06-22 11:11:44 +0200
committerKristian Evers <kristianevers@gmail.com>2017-06-22 12:48:51 +0200
commit0bcfd26141c717fa7b91b30c831fc59936c155e3 (patch)
treed05177832f9e8e210366b9f785a6117cb999be6e
parent4cf473f9ba1c90f8c2d2945d85ca6e42466ecf1a (diff)
downloadPROJ-0bcfd26141c717fa7b91b30c831fc59936c155e3.tar.gz
PROJ-0bcfd26141c717fa7b91b30c831fc59936c155e3.zip
Use *pj_get_errno_ref() instead of pj_errno because it seems pj_errno is not set correctly on some versions of VS. Fixes #484.
-rw-r--r--src/proj.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/proj.c b/src/proj.c
index 2f89560d..8734d2ce 100644
--- a/src/proj.c
+++ b/src/proj.c
@@ -209,8 +209,10 @@ vprocess(FILE *fid) {
dat_xy = pj_fwd(dat_ll, Proj);
if (postscale) { dat_xy.u *= fscale; dat_xy.v *= fscale; }
}
- if (pj_errno) {
- emess(-1, pj_strerrno(pj_errno));
+ /* For some reason pj_errno does not work as expected in some */
+ /* versions of Visual Studio, so using pj_get_errno_ref instead */
+ if (*pj_get_errno_ref()) {
+ emess(-1, pj_strerrno(*pj_get_errno_ref()));
continue;
}
if (!*s && (s > line)) --s; /* assumed we gobbled \n */