Fix:Core:Applied patch from diekhans for better posix compatibility
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 4 Jan 2008 22:10:11 +0000 (22:10 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 4 Jan 2008 22:10:11 +0000 (22:10 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@712 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/src/binding/python/binding_python.c
navit/src/file.c
navit/src/gui/gtk/datawindow.c
navit/src/main.c
navit/src/osm2navit.c
navit/src/param.c

index cb33f83..9777793 100644 (file)
@@ -4,6 +4,7 @@
 #include <fcntl.h>
 #include "coord.h"
 #include "projection.h"
+#include <glib.h>
 #include "map.h"
 #include "mapset.h"
 #include "plugin.h"
index 93bf4f8..c2cf8cf 100644 (file)
 #include "debug.h"
 #include "file.h"
 
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
 static struct file *file_list;
 
 struct file *
index 549de73..8a3a5f1 100644 (file)
@@ -1,4 +1,3 @@
-#include <malloc.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
index 60a490f..4476e6a 100644 (file)
@@ -6,6 +6,7 @@
 #include <glib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <signal.h>
 #include <unistd.h>
 #include <libintl.h>
 #ifdef USE_GTK_MAIN_LOOP
index d17a2a6..0834259 100644 (file)
@@ -3,7 +3,6 @@
 #define _LARGEFILE64_SOURCE
 #include <glib.h>
 #include <assert.h>
-#include <malloc.h>
 #include <string.h>
 #include <signal.h>
 #include <stdlib.h>
@@ -720,7 +719,7 @@ static void
 save_buffer(char *filename, struct buffer *b)
 {      
        FILE *f;
-       f=fopen64(filename,"wb+");
+       f=fopen(filename,"wb+");
        fwrite(b->base, b->size, 1, f);
        fclose(f);
 }
@@ -732,7 +731,7 @@ load_buffer(char *filename, struct buffer *b)
        if (b->base) 
                free(b->base);
        b->malloced=0;
-       f=fopen64(filename,"rb");
+       f=fopen(filename,"rb");
        fseek(f, 0, SEEK_END);
        b->size=b->malloced=ftell(f);
        fprintf(stderr,"reading %d bytes from %s\n", b->size, filename);
@@ -1033,7 +1032,7 @@ write_tile(char *key, struct tile_head *th, gpointer dummy)
 #if 0
        strcat(buffer,".bin");
 #endif
-       f=fopen64(buffer, "wb+");
+       f=fopen(buffer, "wb+");
        while (th) {
                fwrite(th->data, th->size, 1, f);
                th=th->next;
@@ -1760,9 +1759,9 @@ int main(int argc, char **argv)
 
        if (start == 1) {
                if (process_ways)
-                       ways=fopen64("ways.tmp","wb+");
+                       ways=fopen("ways.tmp","wb+");
                if (process_nodes)
-                       nodes=fopen64("nodes.tmp","wb+");
+                       nodes=fopen("nodes.tmp","wb+");
                phase=1;
                fprintf(stderr,"PROGRESS: Phase 1: collecting data\n");
                phase1(stdin,ways,nodes);
@@ -1779,8 +1778,8 @@ int main(int argc, char **argv)
                load_buffer("coords.tmp",&node_buffer);
        if (start <= 2) {
                if (process_ways) {
-                       ways=fopen64("ways.tmp","rb");
-                       ways_split=fopen64("ways_split.tmp","wb+");
+                       ways=fopen("ways.tmp","rb");
+                       ways_split=fopen("ways_split.tmp","wb+");
                        phase=2;
                        fprintf(stderr,"PROGRESS: Phase 2: finding intersections\n");
                        phase2(ways,ways_split);
@@ -1801,10 +1800,10 @@ int main(int argc, char **argv)
                phase=3;
                fprintf(stderr,"PROGRESS: Phase 3: generating tiles\n");
                if (process_ways)
-                       ways_split=fopen64("ways_split.tmp","rb");
+                       ways_split=fopen("ways_split.tmp","rb");
                if (process_nodes)
-                       nodes=fopen64("nodes.tmp","rb");
-               tilesdir=fopen64("tilesdir.tmp","wb+");
+                       nodes=fopen("nodes.tmp","rb");
+               tilesdir=fopen("tilesdir.tmp","wb+");
                phase3(ways_split,nodes,tilesdir);
                fclose(tilesdir);
                if (nodes)
@@ -1818,11 +1817,11 @@ int main(int argc, char **argv)
                phase=4;
                fprintf(stderr,"PROGRESS: Phase 4: assembling map\n");
                if (process_ways)
-                       ways_split=fopen64("ways_split.tmp","rb");
+                       ways_split=fopen("ways_split.tmp","rb");
                if (process_nodes)
-                       nodes=fopen64("nodes.tmp","rb");
-               res=fopen64(result,"wb+");
-               zipdir=fopen64("zipdir.tmp","wb+");
+                       nodes=fopen("nodes.tmp","rb");
+               res=fopen(result,"wb+");
+               zipdir=fopen("zipdir.tmp","wb+");
                phase4(ways_split,nodes,res,zipdir,compression_level);
                fclose(zipdir);
                fclose(res);
index 0b3296e..94157a5 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 #include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include "param.h"
 
 void