Skip to content

Commit 87502c1

Browse files
committed
[XDK] winnt_old.h: Fix definition of __WINE_MALLOC / __WINE_DEALLOC
This is to prevent redefinition warnings when including wine's corecrt.h The additional !defined(malloc) prevents errors when compiling libwine, which defines malloc to libwine_malloc.
1 parent 629e844 commit 87502c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sdk/include/xdk/winnt_old.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,16 @@
8383
#else
8484
# define __WINE_ALLOC_SIZE(...)
8585
#endif
86+
#if defined(__GNUC__) && (__GNUC__ > 10) && !defined(malloc)
87+
#define __WINE_DEALLOC(...) __attribute__((malloc (__VA_ARGS__)))
88+
#else
8689
#define __WINE_DEALLOC(...)
90+
#endif
91+
#if defined(__GNUC__) && (__GNUC__ > 2) && !defined(malloc)
92+
#define __WINE_MALLOC __attribute__((malloc))
93+
#else
8794
#define __WINE_MALLOC
95+
#endif
8896
/*#endif*/
8997

9098
#ifdef __GNUC__

0 commit comments

Comments
 (0)