From 685ec05e3f5a249940370194d140032958182d89 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 5 Feb 2008 13:54:30 +0000 Subject: [PATCH] Fixed some compilations problems in Linux. And a bug in file_system to get the root / file-item key. --- src/core/file_system.c | 8 ++++++++ src/dialogs/filesel.c | 4 ++++ src/jinete/jthread.c | 14 +++++++------- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/core/file_system.c b/src/core/file_system.c index 18fd02330..bef9c897c 100644 --- a/src/core/file_system.c +++ b/src/core/file_system.c @@ -73,6 +73,10 @@ #define FA_TO_SHOW FA_RDONLY | FA_DIREC | FA_ARCH | FA_SYSTEM #endif +#ifndef MAX_PATH +# define MAX_PATH 4096 +#endif + /* a position in the file-system */ struct FileItem { @@ -912,6 +916,10 @@ static char *remove_backslash(char *filename) removed */ if (len == 3 && filename[1] == DEVICE_SEPARATOR) return filename; +#else + /* this is just the root '/' slash */ + if (len == 1) + return filename; #endif filename[len-1] = 0; } diff --git a/src/dialogs/filesel.c b/src/dialogs/filesel.c index 4759d60df..e1cee57d6 100644 --- a/src/dialogs/filesel.c +++ b/src/dialogs/filesel.c @@ -39,6 +39,10 @@ # define HAVE_DRIVES #endif +#ifndef MAX_PATH +# define MAX_PATH 4096 +#endif + /* Variables used only to maintain the history of navigation. */ static JLink navigation_position = NULL; /* current position in the navigation history */ static JList navigation_history = NULL; /* set of FileItems navigated */ diff --git a/src/jinete/jthread.c b/src/jinete/jthread.c index d109add1e..ba050d319 100644 --- a/src/jinete/jthread.c +++ b/src/jinete/jthread.c @@ -40,26 +40,26 @@ defined ALLEGRO_MACOSX || \ defined ALLEGRO_BEOS || \ defined ALLEGRO_QNX -#define UNIX_LIKE +# define UNIX_LIKE #endif #if defined ALLEGRO_WINDOWS -#include -#include +# include +# include #elif defined UNIX_LIKE -#include +# include #endif #if defined UNIX_LIKE struct pthread_proxy_data { - void (*proc)(JThread thread, void *data); + void (*proc)(void *data); void *data; }; static void *pthread_proxy(void *arg) { - pthread_proxy_data *ptr = arg; - void (*proc)(JThread thread, void *data) = ptr->proc; + struct pthread_proxy_data *ptr = arg; + void (*proc)(void *data) = ptr->proc; void *data = ptr->data; jfree(ptr);