From 10829b2f78de91f66c7da5f7a2a2fe6d252eb38d Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Thu, 3 May 2012 07:08:43 +0200 Subject: Fix fat test program not compiling (FS#12646). This changes the way creat() is wrapped around in native builds so more experienced devs should look at it. This patch forces to compile fat test in 32bit mode. Building natively on x86-64 works just fine but our fat code apparently can't deal with 64bit pointers/ints correctly. Change-Id: I000015094f7db957ce826c22672608cd419908b0 Reviewed-on: http://gerrit.rockbox.org/228 Reviewed-by: Thomas Martitz --- firmware/include/file.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'firmware/include/file.h') diff --git a/firmware/include/file.h b/firmware/include/file.h index 198fccbc7b..0ff94a8168 100644 --- a/firmware/include/file.h +++ b/firmware/include/file.h @@ -82,17 +82,15 @@ extern int fsync(int fd); extern ssize_t read(int fd, void *buf, size_t count); extern off_t lseek(int fildes, off_t offset, int whence); extern int file_creat(const char *pathname); -#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(__PCTOOL__) -/* posix compatibility function */ -static inline int creat(const char *pathname, mode_t mode) -{ - (void)mode; - return file_creat(pathname); -} +#if ((CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(__PCTOOL__)) || \ + defined(TEST_FAT) +#define creat(x, y) file_creat(x) + #if !defined(CODEC) && !defined(PLUGIN) #define open(x, y, ...) file_open(x,y) #endif #endif + extern ssize_t write(int fd, const void *buf, size_t count); extern int remove(const char* pathname); extern int rename(const char* path, const char* newname); -- cgit v1.2.3