summaryrefslogtreecommitdiffstats
path: root/include/utils
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-09-22 20:50:54 -0700
committerElliott Hughes <enh@google.com>2014-09-22 20:50:54 -0700
commitcb3d65323d69ee1c101a1fa04e0d0e0929ef0f4f (patch)
tree3dca492072fd193f5ea3357cca7627f79ae047cc /include/utils
parentfed0f06bf04c6de90ae7b2f8ae9158ab2200498e (diff)
downloadsystem_core-cb3d65323d69ee1c101a1fa04e0d0e0929ef0f4f.zip
system_core-cb3d65323d69ee1c101a1fa04e0d0e0929ef0f4f.tar.gz
system_core-cb3d65323d69ee1c101a1fa04e0d0e0929ef0f4f.tar.bz2
defined(HAVE_OFF_T) is really just !defined(__APPLE__).
Change-Id: I83c271bfe24b777acf293d2b4ac5af2cce8398b9
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/Compat.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/include/utils/Compat.h b/include/utils/Compat.h
index fb7748e..20a6920 100644
--- a/include/utils/Compat.h
+++ b/include/utils/Compat.h
@@ -19,11 +19,9 @@
#include <unistd.h>
-/* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */
-#ifndef HAVE_OFF64_T
-#if _FILE_OFFSET_BITS < 64
-#error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform"
-#endif /* _FILE_OFFSET_BITS < 64 */
+#if defined(__APPLE__)
+
+/* Mac OS has always had a 64-bit off_t, so it doesn't have off64_t. */
typedef off_t off64_t;
@@ -31,13 +29,11 @@ static inline off64_t lseek64(int fd, off64_t offset, int whence) {
return lseek(fd, offset, whence);
}
-#ifdef HAVE_PREAD
static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) {
return pread(fd, buf, nbytes, offset);
}
-#endif
-#endif /* !HAVE_OFF64_T */
+#endif /* __APPLE__ */
#if HAVE_PRINTF_ZD
# define ZD "%zd"