ソースを参照

vlib(pg): fix compilation issue (no-gdal)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@51032 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 年 前
コミット
a2e736ad23
2 ファイル変更6 行追加4 行削除
  1. 1 0
      lib/vector/Vlib/open_pg.c
  2. 5 4
      lib/vector/Vlib/write_pg.c

+ 1 - 0
lib/vector/Vlib/open_pg.c

@@ -14,6 +14,7 @@
  */
 
 #include <string.h>
+#include <stdlib.h>
 
 #include <grass/vector.h>
 #include <grass/dbmi.h>

+ 5 - 4
lib/vector/Vlib/write_pg.c

@@ -21,6 +21,8 @@
    \author Martin Landa <landa.martin gmail.com>
  */
 
+#include <string.h>
+
 #include <grass/vector.h>
 #include <grass/glocale.h>
 
@@ -466,7 +468,7 @@ unsigned char *polygon_to_wkb(int byte_order,
     if (byte_order == ENDIAN_BIG) {
         int ncount;
 	
-        ncount = CPL_SWAP32(nrings);
+        ncount = SWAP32(nrings);
         memcpy(wkb_data + 5, &ncount, 4);
     }
     else {
@@ -492,9 +494,8 @@ unsigned char *polygon_to_wkb(int byte_order,
         memcpy(wkb_data+5, &npoints, 4);
 
 	nitems = (with_z ? 3 : 2) * points->n_points;
-        for(i = 0; i < nitems; i++ )
-        {
-            CPL_SWAPDOUBLE(wkb_data + 9 + 4 + 8 * i);
+        for(i = 0; i < nitems; i++ ) {
+            SWAPDOUBLE(wkb_data + 9 + 4 + 8 * i);
         }
     }