aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2011-11-10 00:00:55 +0800
committerdanfe <danfe@FreeBSD.org>2011-11-10 00:00:55 +0800
commit00c6ce5d01e49d619a2497960f6775c0d29fdad1 (patch)
tree8d1927d0d11b64635815f858b6aef69d7675d467 /games
parentb227b572d808bc9da030a9f4a079976d44caca94 (diff)
downloadfreebsd-ports-graphics-00c6ce5d01e49d619a2497960f6775c0d29fdad1.tar.gz
freebsd-ports-graphics-00c6ce5d01e49d619a2497960f6775c0d29fdad1.tar.zst
freebsd-ports-graphics-00c6ce5d01e49d619a2497960f6775c0d29fdad1.zip
Unbreak on amd64 by replacing obsolete memalign() function with POSIX.1d
posix_memalign(). Reported by: pavmail
Diffstat (limited to 'games')
-rw-r--r--games/battletanks/files/patch-clunk-sse_fft_context.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/games/battletanks/files/patch-clunk-sse_fft_context.cpp b/games/battletanks/files/patch-clunk-sse_fft_context.cpp
new file mode 100644
index 00000000000..4c67c15fb5f
--- /dev/null
+++ b/games/battletanks/files/patch-clunk-sse_fft_context.cpp
@@ -0,0 +1,18 @@
+--- clunk/sse_fft_context.cpp.orig 2011-11-09 20:57:22.000000000 +0600
++++ clunk/sse_fft_context.cpp 2011-11-09 20:58:53.371320298 +0600
+@@ -1,5 +1,4 @@
+ #include <stdlib.h>
+-#include <malloc.h>
+ #include <stdio.h>
+ #include <new>
+ #include "fft_context.h"
+@@ -12,7 +12,8 @@
+ #ifdef _WINDOWS
+ ptr = _aligned_malloc(size, alignment);
+ #else
+- ptr = memalign(alignment, size);
++ if (posix_memalign(&ptr, alignment, size))
++ ptr = NULL;
+ #endif
+ if (ptr == NULL)
+ throw std::bad_alloc();