From Mandriva. Realigned for Gentoo by Peter Alfredsen --- SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c 2007-03-05 16:10:28.000000000 +0100 +++ SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c 2007-03-05 16:35:31.000000000 +0100 @@ -27,17 +27,12 @@ #include #include #include #include #include -#include /* For definition of PAGE_SIZE */ #include -#ifndef PAGE_SIZE -# define PAGE_SIZE sysconf(_SC_PAGE_SIZE) -#endif - #include "SDL_video.h" #include "SDL_mouse.h" #include "../SDL_sysvideo.h" #include "../SDL_pixels_c.h" #include "../../events/SDL_events_c.h" @@ -549,11 +544,11 @@ } } /* Memory map the device, compensating for buggy PPC mmap() */ mapped_offset = (((long)finfo.smem_start) - - (((long)finfo.smem_start)&~(PAGE_SIZE-1))); + (((long)finfo.smem_start)&~((int)sysconf(_SC_PAGE_SIZE)-1))); mapped_memlen = finfo.smem_len+mapped_offset; mapped_mem = do_mmap(NULL, mapped_memlen, PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0); if ( mapped_mem == (char *)-1 ) { SDL_SetError("Unable to memory map the video hardware"); --- SDL-1.2.11.orig/src/video/ps2gs/SDL_gsyuv.c 2007-03-05 16:10:28.000000000 +0100 +++ SDL-1.2.11/src/video/ps2gs/SDL_gsyuv.c 2007-03-05 16:29:36.000000000 +0100 @@ -25,12 +25,11 @@ #include #include #include #include -#include /* For definition of PAGE_SIZE */ - +/* There is no PAGE_SIZE define anymore, use sysconf from unistd.h instead */ #ifndef PAGE_SIZE # define PAGE_SIZE sysconf(_SC_PAGE_SIZE) #endif #include "SDL_video.h" @@ -182,11 +181,11 @@ return(NULL); } /* Allocate a DMA area for pixel conversion */ bpp = this->screen->format->BytesPerPixel; - map_offset = (mapped_len + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1); + map_offset = (mapped_len + ((int)sysconf(_SC_PAGE_SIZE) - 1)) & ~((int)sysconf(_SC_PAGE_SIZE) - 1); hwdata->dma_len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8) + width * height * bpp + hwdata->macroblocks * (16 * sizeof(long long)) + 12 * sizeof(long long); hwdata->dma_mem = mmap(0, hwdata->dma_len, PROT_READ|PROT_WRITE, --- SDL-1.2.11.orig/src/video/Xext/Xxf86dga/XF86DGA.c 2006-05-01 10:02:47.000000000 +0200 +++ SDL-1.2.11/src/video/Xext/Xxf86dga/XF86DGA.c 2007-03-05 16:31:56.000000000 +0100 @@ -16,11 +16,10 @@ #if defined(linux) #define HAS_MMAP_ANON #include #include -#include /* PAGE_SIZE */ #define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */ #define HAS_GETPAGESIZE #endif /* linux */ #if defined(CSRG_BASED) @@ -489,14 +488,10 @@ #endif #ifdef HAS_GETPAGESIZE if (pagesize == -1) pagesize = getpagesize(); #endif -#ifdef PAGE_SIZE - if (pagesize == -1) - pagesize = PAGE_SIZE; -#endif if (pagesize == -1) pagesize = 4096; delta = address % pagesize; offset = address - delta;