From: Marat Radchenko Date: Tue, 30 Sep 2014 07:02:40 GMT Subject: [PATCH 11/14] compat/nedmalloc/malloc.c.h: fix compilation under MinGW-W64 Message-ID: <1412060563-22041-12-git-send-email-marat@slonopotamus.org> In-Reply-To: <1412060563-22041-1-git-send-email-marat@slonopotamus.org> 1. Unlike MinGW, MinGW-W64 already provides _ReadWriteBarrier macro, so don't try to redefine it. 2. MinGW-W64 has a strange definition FORCEINLINE as extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) 'extern' doesn't work together with 'static', so #undef MinGW-W64 version of FORCEINLINE. Signed-off-by: Marat Radchenko --- compat/nedmalloc/malloc.c.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h index f216a2a..a6c8cac 100644 --- a/compat/nedmalloc/malloc.c.h +++ b/compat/nedmalloc/malloc.c.h @@ -715,6 +715,10 @@ struct mallinfo { #endif /* HAVE_USR_INCLUDE_MALLOC_H */ #endif /* NO_MALLINFO */ +#ifdef __MINGW64_VERSION_MAJOR + #undef FORCEINLINE +#endif + /* Try to persuade compilers to inline. The most critical functions for inlining are defined as macros, so these aren't used for them. @@ -1382,7 +1386,9 @@ LONG __cdecl _InterlockedExchange(LONG volatile *Target, LONG Value); /*** Atomic operations ***/ #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 - #define _ReadWriteBarrier() __sync_synchronize() + #ifndef _ReadWriteBarrier + #define _ReadWriteBarrier() __sync_synchronize() + #endif #else static __inline__ __attribute__((always_inline)) long __sync_lock_test_and_set(volatile long * const Target, const long Value) { -- 2.1.1 -- -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en --- You received this message because you are subscribed to the Google Groups "Git for Windows" group. To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.