#include "pipe/p_compiler.h"
#if defined(PIPE_OS_UNIX)
-# ifndef _FILE_OFFSET_BITS
-# error _FILE_OFFSET_BITS must be defined to 64
-# endif
# include <sys/mman.h>
#else
# error Unsupported OS
# define os_mmap(addr, length, prot, flags, fd, offset) mmap(addr, length, prot, flags, fd, offset)
#endif
-#define os_munmap(addr, length) munmap(addr, length)
+static INLINE int os_munmap(void *addr, size_t length)
+{
+ /* Copied from configure code generated by AC_SYS_LARGEFILE */
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+ STATIC_ASSERT(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1);
+#undef LARGE_OFF_T
+
+ return munmap(addr, length);
+}
#ifdef __cplusplus