From: Ulf Samuelsson Date: Sat, 11 Aug 2007 22:09:09 +0000 (-0000) Subject: Fix mismatch in SDL patch naming convention X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=927c01dd4a45623df173880c2b54ec8024cd8964;p=buildroot.git Fix mismatch in SDL patch naming convention --- diff --git a/package/sdl/SDL-1.2.11-patch_PAGE_SIZE.patch b/package/sdl/SDL-1.2.11-patch_PAGE_SIZE.patch deleted file mode 100644 index ece702d8d8..0000000000 --- a/package/sdl/SDL-1.2.11-patch_PAGE_SIZE.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff -urN SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c ---- SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c 2006-05-17 06:16:06.000000000 +0300 -+++ SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c 2007-06-24 22:19:41.000000000 +0300 -@@ -29,9 +29,17 @@ - #include - #include - #include --#include /* For definition of PAGE_SIZE */ - #include - -+#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 */ -+ - #include "SDL_video.h" - #include "SDL_mouse.h" - #include "../SDL_sysvideo.h" -@@ -474,6 +482,7 @@ - unsigned int current_h; - const char *SDL_fbdev; - FILE *modesdb; -+ int pagesize = -1; - - /* Initialize the library */ - SDL_fbdev = SDL_getenv("SDL_FBDEV"); -@@ -545,9 +554,27 @@ - } - } - -+#if defined(_SC_PAGESIZE) && defined(HAS_SC_PAGESIZE) -+ pagesize = sysconf(_SC_PAGESIZE); -+#endif -+#ifdef _SC_PAGE_SIZE -+ if (pagesize == -1) -+ pagesize = sysconf(_SC_PAGE_SIZE); -+#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; -+ - /* 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)&~(pagesize-1))); - mapped_memlen = finfo.smem_len+mapped_offset; - mapped_mem = do_mmap(NULL, mapped_memlen, - PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0); diff --git a/package/sdl/sdl-1.2.11-patch_PAGE_SIZE.patch b/package/sdl/sdl-1.2.11-patch_PAGE_SIZE.patch new file mode 100644 index 0000000000..ece702d8d8 --- /dev/null +++ b/package/sdl/sdl-1.2.11-patch_PAGE_SIZE.patch @@ -0,0 +1,59 @@ +diff -urN SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c +--- SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c 2006-05-17 06:16:06.000000000 +0300 ++++ SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c 2007-06-24 22:19:41.000000000 +0300 +@@ -29,9 +29,17 @@ + #include + #include + #include +-#include /* For definition of PAGE_SIZE */ + #include + ++#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 */ ++ + #include "SDL_video.h" + #include "SDL_mouse.h" + #include "../SDL_sysvideo.h" +@@ -474,6 +482,7 @@ + unsigned int current_h; + const char *SDL_fbdev; + FILE *modesdb; ++ int pagesize = -1; + + /* Initialize the library */ + SDL_fbdev = SDL_getenv("SDL_FBDEV"); +@@ -545,9 +554,27 @@ + } + } + ++#if defined(_SC_PAGESIZE) && defined(HAS_SC_PAGESIZE) ++ pagesize = sysconf(_SC_PAGESIZE); ++#endif ++#ifdef _SC_PAGE_SIZE ++ if (pagesize == -1) ++ pagesize = sysconf(_SC_PAGE_SIZE); ++#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; ++ + /* 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)&~(pagesize-1))); + mapped_memlen = finfo.smem_len+mapped_offset; + mapped_mem = do_mmap(NULL, mapped_memlen, + PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);