summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f0ed822)
raw | patch | inline | side by side (parent: f0ed822)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Mon, 8 Jun 2009 14:46:49 +0000 (16:46 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 8 Jun 2009 16:43:37 +0000 (09:43 -0700) |
Nedmalloc's source code has a cute #define construct to avoid inserting
an if() statement, because that might interact badly with enclosing if()
statements. However, GCC > 4 complains with a "warning: value computed
is not used". So we cast the result to "void".
GCC also does not understand the Visual C++ specific pragmas, so we need
to disable them for MinGW.
We need to include malloc.h on Windows even if we happen to compile the
stuff as a MinGW program. Otherwise the function declaration of alloca()
is missing.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
an if() statement, because that might interact badly with enclosing if()
statements. However, GCC > 4 complains with a "warning: value computed
is not used". So we cast the result to "void".
GCC also does not understand the Visual C++ specific pragmas, so we need
to disable them for MinGW.
We need to include malloc.h on Windows even if we happen to compile the
stuff as a MinGW program. Otherwise the function declaration of alloca()
is missing.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/nedmalloc/malloc.c.h | patch | blob | history | |
compat/nedmalloc/nedmalloc.c | patch | blob | history |
index bb0f482d9fc087a143335e159605cf08b7d51191..b5b1495c7e9172d7acbbb596f5a8b48a0baf17b8 100644 (file)
/*------------------------------ internal #includes ---------------------- */
#ifdef WIN32
+#ifndef __GNUC__
#pragma warning( disable : 4146 ) /* no "unsigned" warnings */
+#endif
#endif /* WIN32 */
#include <stdio.h> /* for printing in malloc_stats */
static struct malloc_params mparams;
/* Ensure mparams initialized */
-#define ensure_initialization() (mparams.magic != 0 || init_mparams())
+#define ensure_initialization() ((void)(mparams.magic == 0 || init_mparams()))
#if !ONLY_MSPACES
index 41a3234e4ea29f972d67870958e8bd8e6f52cbad..d9a17a8057c5740edea3d7888c4607e63af9eddd 100644 (file)
/*#define FULLSANITYCHECKS*/
#include "nedmalloc.h"
-#if defined(WIN32) && !defined(__MINGW32__)
+#if defined(WIN32)
#include <malloc.h>
#endif
#define MSPACES 1