Fix:Core:MSVC fixes
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 25 Jan 2011 15:19:59 +0000 (15:19 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 25 Jan 2011 15:19:59 +0000 (15:19 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4023 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/debug.c
navit/navit/file.c

index 0548a3c..d69d066 100644 (file)
@@ -328,6 +328,9 @@ debug_malloc(const char *where, int line, const char *func, int size)
        if (head->next) 
                head->next->prev=head;
        head->where=g_strdup_printf("%s:%d %s",where,line,func);
+#if !defined (__GNUC__)
+#define __builtin_return_address(x) NULL
+#endif
        head->return_address[0]=__builtin_return_address(0);
        head->return_address[1]=__builtin_return_address(1);
        head->return_address[2]=__builtin_return_address(2);
index c2391ab..1177973 100644 (file)
@@ -261,6 +261,10 @@ file_create_url(char *url)
 }
 #endif
 
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
 int file_is_dir(char *name)
 {
        struct stat buf;