Skip to content

Commit a463c38

Browse files
committed
avoid issue compiling on a mac
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
1 parent 429ab4d commit a463c38

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

external/deflate/common_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ typedef size_t machine_word_t;
309309
#define MAX(a, b) ((a) >= (b) ? (a) : (b))
310310
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
311311
#define STATIC_ASSERT(expr) ((void)sizeof(char[1 - 2 * !(expr)]))
312-
#define ALIGN(n, a) (((n) + (a) - 1) & ~((a) - 1))
312+
#define DEFLATE_ALIGN(n, a) (((n) + (a) - 1) & ~((a) - 1))
313313
#define ROUND_UP(n, d) ((d) * DIV_ROUND_UP((n), (d)))
314314

315315
/* ========================================================================== */

external/deflate/lib/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ libdeflate_aligned_malloc(malloc_func_t malloc_func,
4646
if (ptr) {
4747
void *orig_ptr = ptr;
4848

49-
ptr = (void *)ALIGN((uintptr_t)ptr + sizeof(void *), alignment);
49+
ptr = (void *)DEFLATE_ALIGN((uintptr_t)ptr + sizeof(void *), alignment);
5050
((void **)ptr)[-1] = orig_ptr;
5151
}
5252
return ptr;

external/patchup_deflate_lib.sed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
s/visibility("default/visibility("hidden/g
22
s/__declspec(dllexport)//g
3+
s/ALIGN(/DEFLATE_ALIGN(/g

share/util/check_deflate.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ if [[ -e current_deflate_version ]]; then
2424
rm -f libdeflate-config.cmake.in
2525
rm -rf scripts
2626
sed -i -f ../patchup_deflate_lib.sed lib/lib_common.h
27+
sed -i -f ../patchup_deflate_lib.sed common_defs.h
28+
sed -i -f ../patchup_deflate_lib.sed lib/utils.c
2729
cd ..
2830

2931
rm "${filename}"

0 commit comments

Comments
 (0)