[postgis-tickets] [PostGIS] #4877: PostgreSQL 14 / windows can't compile PostGIS

PostGIS trac at osgeo.org
Wed Mar 10 20:16:43 PST 2021


#4877: PostgreSQL 14 / windows can't compile PostGIS
----------------------+------------------------------
  Reporter:  robe     |      Owner:  robe
      Type:  defect   |     Status:  assigned
  Priority:  blocker  |  Milestone:  PostGIS 3.2.0
 Component:  postgis  |    Version:  master
Resolution:           |   Keywords:  windows, mingw64
----------------------+------------------------------

Comment (by robe):

 Seems they introduced this line in include/server/port/win32_port.h
 which is conflicting with mingw64 definition.  Might be my mingw is old
 and shouldn't have it defined or they should have a mingw64 guard around
 this like they have other sections of the win32_port.h


 {{{
 #define stat microsoft_native_stat
 }}}

 also

 {{{
 C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:258:8:
 error: redefinition of 'struct stat'
  struct stat      /* This should match struct __stat64 */
         ^~~~
 /*
  * Supplement to <sys/stat.h>.
  *
  * We must pull in sys/stat.h before this part, else our overrides lose.
  *
  * stat() is not guaranteed to set the st_size field on win32, so we
  * redefine it to our own implementation.  See src/port/win32stat.c.
  *
  * The struct stat is 32 bit in MSVC, so we redefine it as a copy of
  * struct __stat64.  This also fixes the struct size for MINGW builds.
  */
 struct stat                                             /* This should
 match struct __stat64 */
 {
         _dev_t          st_dev;
         _ino_t          st_ino;
         unsigned short st_mode;
         short           st_nlink;
         short           st_uid;
         short           st_gid;
         _dev_t          st_rdev;
         __int64         st_size;
         __time64_t      st_atime;
         __time64_t      st_mtime;
         __time64_t      st_ctime;
 };
 }}}

 I put a
 {{{
 #if !defined(__MINGW64_VERSION_MAJOR) || defined(_MSC_VER)

 #endif
 }}}

 guard around these sections that allowed me to compile.  I'll report as
 possible bug upstream.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4877#comment:1>
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