diff options
author | M.Dinslage <daedra1980@gmail.com> | 2021-09-04 11:08:15 +0200 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-09-06 08:50:31 +0700 |
commit | 32baca649e83cba3288a8e17223ff186867f3f6e (patch) | |
tree | c76380db88573ce3ae555f993fb46a6c84b9c0e7 /games/darkplaces | |
parent | b53ebffb0fa4087f5ba2de847c181eed5864250e (diff) | |
download | slackbuilds-32baca649e83cba3288a8e17223ff186867f3f6e.tar.gz |
games/darkplaces: Patch for gcc >= 11.x.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/darkplaces')
-rw-r--r-- | games/darkplaces/darkplaces.SlackBuild | 3 | ||||
-rw-r--r-- | games/darkplaces/gcc11.patch | 89 |
2 files changed, 92 insertions, 0 deletions
diff --git a/games/darkplaces/darkplaces.SlackBuild b/games/darkplaces/darkplaces.SlackBuild index 3fc95fddd0..1fcf44a837 100644 --- a/games/darkplaces/darkplaces.SlackBuild +++ b/games/darkplaces/darkplaces.SlackBuild @@ -100,6 +100,9 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +( cd darkplaces + patch -p1 < $CWD/gcc11.patch ) + if [ "$SOURCE" != "NO" ]; then cd $PRGNAM make OPTIM_RELEASE="$SLKCFLAGS" release diff --git a/games/darkplaces/gcc11.patch b/games/darkplaces/gcc11.patch new file mode 100644 index 0000000000..ec653f8bc8 --- /dev/null +++ b/games/darkplaces/gcc11.patch @@ -0,0 +1,89 @@ +--- a/dpsoftrast.c 2013-02-07 11:40:40.000000000 +0000 ++++ b/dpsoftrast.c 2021-04-30 04:45:31.276607019 +0000 +@@ -21,6 +21,7 @@ + #if defined(__APPLE__) + #include <libkern/OSAtomic.h> + #define ALIGN(var) var __attribute__((__aligned__(16))) ++ #define ALIGN_STRUCT(def) struct __attribute__((__aligned__(16))) def + #define ATOMIC(var) var __attribute__((__aligned__(4))) + #define MEMORY_BARRIER (_mm_sfence()) + #define ATOMIC_COUNTER volatile int32_t +@@ -29,6 +30,7 @@ + #define ATOMIC_ADD(counter, val) ((void)OSAtomicAdd32Barrier((val), &(counter))) + #elif defined(__GNUC__) && defined(WIN32) + #define ALIGN(var) var __attribute__((__aligned__(16))) ++ #define ALIGN_STRUCT(def) struct __attribute__((__aligned__(16))) def + #define ATOMIC(var) var __attribute__((__aligned__(4))) + #define MEMORY_BARRIER (_mm_sfence()) + //(__sync_synchronize()) +@@ -43,6 +45,7 @@ + #define ATOMIC_ADD(counter, val) ((void)InterlockedExchangeAdd((LONG *) &(counter), (val))) + #elif defined(__GNUC__) + #define ALIGN(var) var __attribute__((__aligned__(16))) ++ #define ALIGN_STRUCT(def) struct __attribute__((__aligned__(16))) def + #define ATOMIC(var) var __attribute__((__aligned__(4))) + #define MEMORY_BARRIER (_mm_sfence()) + //(__sync_synchronize()) +@@ -52,6 +55,7 @@ + #define ATOMIC_ADD(counter, val) ((void)__sync_fetch_and_add(&(counter), (val))) + #elif defined(_MSC_VER) + #define ALIGN(var) __declspec(align(16)) var ++ #define ALIGN_STRUCT(def) ALIGN(struct def) + #define ATOMIC(var) __declspec(align(4)) var + #define MEMORY_BARRIER (_mm_sfence()) + //(MemoryBarrier()) +@@ -65,6 +69,9 @@ + #ifndef ALIGN + #define ALIGN(var) var + #endif ++#ifndef ALIGN_STRUCT ++#define ALIGN_STRUCT(def) def ++#endif + #ifndef ATOMIC + #define ATOMIC(var) var + #endif +@@ -163,7 +170,7 @@ + #define DPSOFTRAST_DRAW_MAXCOMMANDPOOL 2097152 + #define DPSOFTRAST_DRAW_MAXCOMMANDSIZE 16384 + +-typedef ALIGN(struct DPSOFTRAST_State_Command_Pool_s ++typedef ALIGN_STRUCT(DPSOFTRAST_State_Command_Pool_s + { + int freecommand; + int usedcommands; +@@ -171,7 +178,7 @@ + } + DPSOFTRAST_State_Command_Pool); + +-typedef ALIGN(struct DPSOFTRAST_State_Triangle_s ++typedef ALIGN_STRUCT(DPSOFTRAST_State_Triangle_s + { + unsigned char mip[DPSOFTRAST_MAXTEXTUREUNITS]; // texcoord to screen space density values (for picking mipmap of textures) + float w[3]; +@@ -198,7 +205,7 @@ + + #define DPSOFTRAST_DRAW_MAXSUBSPAN 16 + +-typedef ALIGN(struct DPSOFTRAST_State_Span_s ++typedef ALIGN_STRUCT(DPSOFTRAST_State_Span_s + { + int triangle; // triangle this span was generated by + int x; // framebuffer x coord +@@ -236,7 +243,7 @@ + } + DPSOFTRAST_BLENDMODE; + +-typedef ALIGN(struct DPSOFTRAST_State_Thread_s ++typedef ALIGN_STRUCT(DPSOFTRAST_State_Thread_s + { + void *thread; + int index; +@@ -302,7 +309,7 @@ + } + DPSOFTRAST_State_Thread); + +-typedef ALIGN(struct DPSOFTRAST_State_s ++typedef ALIGN_STRUCT(DPSOFTRAST_State_s + { + int fb_width; + int fb_height; |