about summary refs log tree commit diff homepage
path: root/runtime/POSIX/fd_32.c
diff options
context:
space:
mode:
authorMartin Nowack <martin.nowack@gmail.com>2013-09-02 17:15:11 +0200
committerMartin Nowack <martin.nowack@gmail.com>2013-09-02 17:19:08 +0200
commit1e63f37178748da804aae3a4735fca73dee5d53a (patch)
tree843a1e6762e2022c884348342682791832d92cc8 /runtime/POSIX/fd_32.c
parent5878249b4f8276773349a1544ea22478afd0ee50 (diff)
downloadklee-1e63f37178748da804aae3a4735fca73dee5d53a.tar.gz
Fixed multiple definitions of POSIX file functions
Function like stat() were defined for 32bit and 64bit version.
Added compile time based selection of appropriate version
using GNUC macros __x86_64__ and __ppc64__.
Diffstat (limited to 'runtime/POSIX/fd_32.c')
-rw-r--r--runtime/POSIX/fd_32.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/POSIX/fd_32.c b/runtime/POSIX/fd_32.c
index 338d9ba2..20587b42 100644
--- a/runtime/POSIX/fd_32.c
+++ b/runtime/POSIX/fd_32.c
@@ -6,7 +6,18 @@
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+// Contains 32bit definitions of posix file functions
+//===---
 
+#if __GNUC__
+#if __x86_64__ || __ppc64__
+#define ENV64
+#else
+#define ENV32
+#endif
+#endif
+
+#ifdef ENV32
 #define _LARGEFILE64_SOURCE
 #include "fd.h"
 
@@ -194,3 +205,5 @@ int fstat64(int fd, struct stat64 *buf) __attribute__((weak));
 int fstat64(int fd, struct stat64 *buf) {
   return __fd_fstat(fd, buf);
 }
+
+#endif