[postgis-tickets] [PostGIS] #4872: Failure on windows - wkt_input

PostGIS trac at osgeo.org
Tue Mar 9 14:26:25 PST 2021


#4872: Failure on windows -  wkt_input
----------------------+---------------------------
  Reporter:  robe     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  blocker  |  Milestone:  PostGIS 3.2.0
 Component:  postgis  |    Version:  master
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by pramsey):

 Here's a patch which should fix your installation and doesn't seem to
 break mine
 {{{
 diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l
 index 273a97966..d301a2259 100644
 --- a/liblwgeom/lwin_wkt_lex.l
 +++ b/liblwgeom/lwin_wkt_lex.l
 @@ -34,6 +34,17 @@ static void wkt_lexer_unknown()
         LWDEBUGF(5,"lex: %s", wkt_yytext); \
         } while (0);

 +/*
 +* Ensure we have a definition of NAN to use when encountering
 +* NAN tokens.
 +*/
 +#ifndef _GNU_SOURCE
 +#define _GNU_SOURCE
 +#endif
 +#include <math.h>
 +#ifndef NAN
 +#define NAN 0.0/0.0
 +#endif

  %}

 @@ -57,7 +68,7 @@ static void wkt_lexer_unknown()

  ([Nn][Aa][Nn])[ \,\)\t\n\r] {
         LWDEBUG(5,"DOUBLE NAN");
 -       wkt_yylval.doublevalue = atof(wkt_yytext);
 +       wkt_yylval.doublevalue = NAN;
         yyless(wkt_yyleng-1);
         return DOUBLE_TOK;
  }
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4872#comment:4>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list