diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-05-02 23:22:26 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-05-02 23:22:26 +0000 |
commit | 9f54645ef6ecd5b460d58572339df2ed2a22b723 (patch) | |
tree | 128e2bd439c5eea6b74eef820b4d8f5c98200b72 /games-strategy/freecnc/files | |
parent | version bump (bug #91090) (diff) | |
download | gentoo-2-9f54645ef6ecd5b460d58572339df2ed2a22b723.tar.gz gentoo-2-9f54645ef6ecd5b460d58572339df2ed2a22b723.tar.bz2 gentoo-2-9f54645ef6ecd5b460d58572339df2ed2a22b723.zip |
fix endian building issues #90949
(Portage version: 2.0.51.21)
Diffstat (limited to 'games-strategy/freecnc/files')
-rw-r--r-- | games-strategy/freecnc/files/freecnc-0.2.0-endian.patch | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/games-strategy/freecnc/files/freecnc-0.2.0-endian.patch b/games-strategy/freecnc/files/freecnc-0.2.0-endian.patch new file mode 100644 index 000000000000..ad8779ace61a --- /dev/null +++ b/games-strategy/freecnc/files/freecnc-0.2.0-endian.patch @@ -0,0 +1,124 @@ +freecnc normally bundles a file called 'endian.h' ... this causes problems +with the real system endian.h. grab upstream cvs fix for this (rename +endian.h to fcnc_endian.h). + +--- src/game/loadmap.cpp ++++ src/game/loadmap.cpp +@@ -8,3 +8,3 @@ + #include "shpimage.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "config.h" +--- src/include/fcnc_endian.h ++++ src/include/fcnc_endian.h +@@ -0,0 +1,68 @@ ++// mode: -*- C++ -*- ++/***************************************************************************** ++ * endian.h - Includes macro definitions to convert bytes to correct endianess ++ * This code has yet to be tested on Big Endian Machines. ++ * ++ * Author: Kareem Dana ++ ****************************************************************************/ ++ ++#ifndef __FCNC_ENDIAN_H ++#define __FCNC_ENDIAN_H ++ ++#include <stdio.h> ++#include "SDL_endian.h" ++ ++#if SDL_BYTEORDER == SDL_LIL_ENDIAN ++ #define readbyte(x,y) x[y] ++ #define readword(x,y) x[y] + (x[y+1] << 8) ++ #define readthree(x,y) x[y] + (x[y+1] << 8) + (x[y+2] << 16) + (0 << 24) ++ #define readlong(x,y) x[y] + (x[y+1] << 8) + (x[y+2] << 16) + (x[y+3] << 24) ++#else ++ #define readbyte(x,y) x[y] ++ #define readword(x,y) SDL_Swap16((x[y] << 8) ^ x[y+1]) ++ #define readthree(x,y) SDL_Swap32((x[y] << 24) ^ (x[y+1] << 16) ^ (x[y+2] << 8)) ++ #define readlong(x,y) SDL_Swap32((x[y] << 24) ^ (x[y+1] << 16) ^ (x[y+2] << 8) ^ (x[y+3])) ++#endif ++ ++static __inline__ Uint8 freadbyte(FILE *fptr) ++{ ++ Uint8 x; ++ fread(&x,1,1,fptr); ++ return x; ++} ++ ++static __inline__ Uint16 freadword(FILE *fptr) ++{ ++ Uint16 x; ++ fread(&x,2,1,fptr); ++#if SDL_BYTEORDER == SDL_BIG_ENDIAN ++ ++ return SDL_Swap16(x); ++#else ++ ++ return x; ++#endif ++} ++ ++static __inline__ Uint32 freadthree(FILE *fptr) ++{ ++ /* Can this be made betteR?? */ ++ Uint8 x[3]; ++ fread(x,3,1,fptr); ++ return readthree(x,0); ++} ++ ++static __inline__ Uint32 freadlong(FILE *fptr) ++{ ++ Uint32 x; ++ fread(&x, 4, 1, fptr); ++#if SDL_BYTEORDER == SDL_BIG_ENDIAN ++ ++ return SDL_Swap32(x); ++#else ++ ++ return x; ++#endif ++} ++ ++#endif +--- src/ui/font.cpp ++++ src/ui/font.cpp +@@ -1,3 +1,3 @@ + #include "font.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "vfs.h" +--- src/vfs/vfs_mix/mixvfs.cpp ++++ src/vfs/vfs_mix/mixvfs.cpp +@@ -2,3 +2,3 @@ + #include "ws-key.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "SDL_endian.h" +--- src/video/cpsimage.cpp ++++ src/video/cpsimage.cpp +@@ -4,3 +4,3 @@ + #include "inifile.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "compression.h" +--- src/video/shpimage.cpp ++++ src/video/shpimage.cpp +@@ -7,3 +7,3 @@ + #include "inifile.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "compression.h" +--- src/video/vqa.cpp ++++ src/video/vqa.cpp +@@ -1,3 +1,3 @@ + #include "compression.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "vfs.h" +--- src/video/wsaimage.cpp ++++ src/video/wsaimage.cpp +@@ -1,3 +1,3 @@ + #include "wsa.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "compression.h" |