Skip to content

Commit 44f4b4f

Browse files
committed
Don't redefine MAX() and MIN() for the 6.11 kernel
The build has become broken once again for the 6.11 kernel: #75 The problem is that the second release candidate introduced generic MAX() and MIN() macros for everyone to use, and that crashes with our own definitions. So, only define them for older kernels. Signed-off-by: Ernesto A. Fernández <[email protected]>
1 parent b44d2a3 commit 44f4b4f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

extents.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
#include <linux/blk_types.h>
99
#include "apfs.h"
1010

11+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
1112
#define MAX(X, Y) ((X) <= (Y) ? (Y) : (X))
13+
#endif
1214

1315
/**
1416
* apfs_ext_is_hole - Does this extent represent a hole in a sparse file?

unicode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
#include <linux/types.h>
1313
#include <linux/nls.h>
1414
#include <linux/ctype.h>
15+
#include <linux/version.h>
1516
#include "unicode.h"
1617

18+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
1719
#define MIN(X, Y) ((X) <= (Y) ? (X) : (Y))
20+
#endif
1821

1922
/* The arrays of unicode data are defined at the bottom of the file */
2023
/* TODO: would a single trie with all the data be more efficient? */

0 commit comments

Comments
 (0)