From Mandriva. Realigned for Gentoo by Peter Alfredsen Index: SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c =================================================================== --- SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c +++ SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c @@ -29,7 +29,6 @@ #include #include #include -#include /* For definition of PAGE_SIZE */ #include #include "SDL_video.h" @@ -547,7 +546,7 @@ static int FB_VideoInit(_THIS, SDL_Pixel /* Memory map the device, compensating for buggy PPC mmap() */ mapped_offset = (((long)finfo.smem_start) - - (((long)finfo.smem_start)&~(getpagesize()-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); Index: SDL-1.2.11/src/video/ps2gs/SDL_gsyuv.c =================================================================== --- SDL-1.2.11.orig/src/video/ps2gs/SDL_gsyuv.c +++ SDL-1.2.11/src/video/ps2gs/SDL_gsyuv.c @@ -27,7 +27,6 @@ #include #include #include -#include /* For definition of PAGE_SIZE */ #include "SDL_video.h" #include "SDL_gsyuv_c.h" @@ -180,7 +179,7 @@ SDL_Overlay *GS_CreateYUVOverlay(_THIS, /* 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)) +