Skip to content

Commit 697c564

Browse files
committed
Fix compiling for x86_64-w64-mingw32
1 parent bf1830d commit 697c564

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

include/internal/macro.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
#ifndef INTERNAL_MACRO_H
44
#define INTERNAL_MACRO_H
55

6+
#include <stdint.h>
7+
#ifndef INTPTR_MAX /* m68k-elf-gcc (atari-st) does not define the optional intptr_t and friends */
8+
# define intptr_t long
9+
#endif
10+
611
/* Macro definitions from the Linux kernel. */
712

813
#define __ALIGN__MASK(x, mask) (((x) + (mask)) & ~(mask))
@@ -40,7 +45,8 @@
4045
* Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
4146
*/
4247
#define __is_constexpr(x) \
43-
(sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
48+
(sizeof(int) == sizeof(*(8 ? ((void *)((intptr_t)(x) * 0)) : (int *)8)))
49+
4450

4551
#define __no_side_effects(x, y) \
4652
(__is_constexpr(x) && __is_constexpr(y))

0 commit comments

Comments
 (0)