aboutsummaryrefslogtreecommitdiffstats
path: root/main/drbd/bits_per_long.patch
blob: 7b094817a467a28ffaa66d4e853bbabbf310dc15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- ./user/drbd_endian.h.orig
+++ ./user/drbd_endian.h
@@ -13,9 +13,16 @@
 
 #include <stdint.h>
 #include <endian.h>
+#include <limits.h>
 
 #ifndef BITS_PER_LONG
-# define BITS_PER_LONG __WORDSIZE
+# ifdef __WORDSIZE
+#  define BITS_PER_LONG __WORDSIZE
+# elif ULONG_MAX == 0xffffffffffffffff
+#  define BITS_PER_LONG 64
+# elif ULONG_MAX == 0xffffffff
+#  define BITS_PER_LONG 32
+# endif
 #endif
 
 /* linux/byteorder/swab.h */