Commit 76b906c9 authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer

configure.ac: Add AC_SYS_LARGEFILE

Making sure large file support is enabled across the tree even on 32-bit
systems.
Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.l.velikov@gmail.com>
parent b4539274
......@@ -57,6 +57,8 @@ AC_CHECK_PROGS([PYTHON2], [python2 python])
AC_PROG_SED
AC_PROG_MKDIR_P
AC_SYS_LARGEFILE
LT_PREREQ([2.2])
LT_INIT([disable-static])
......
......@@ -40,9 +40,6 @@
#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
......@@ -77,7 +74,15 @@ static INLINE void *os_mmap(void *addr, size_t length, int prot, int flags, int
# 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
......
......@@ -24,7 +24,6 @@
* of the Software.
*/
#define _FILE_OFFSET_BITS 64
#include "radeon_drm_cs.h"
#include "util/u_hash_table.h"
......
......@@ -30,7 +30,7 @@ AM_CFLAGS = \
$(LIBDRM_CFLAGS)
#On some systems -std= must be added to CFLAGS to be the last -std=
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64
CFLAGS += -std=gnu99
noinst_LTLIBRARIES = libsvgadrm.la
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment