Integrated fix for cmockery "Issue 3: malloc.h not found on Mac OS Leopard".
authorstewartamiles <stewartamiles@40f4469a-5155-0410-be90-2de3f0bae501>
Thu, 23 Jul 2009 16:33:49 +0000 (16:33 +0000)
committerstewartamiles <stewartamiles@40f4469a-5155-0410-be90-2de3f0bae501>
Thu, 23 Jul 2009 16:33:49 +0000 (16:33 +0000)
git-svn-id: http://cmockery.googlecode.com/svn/trunk@34 40f4469a-5155-0410-be90-2de3f0bae501

src/cmockery.c
src/example/allocate_module.c
src/example/calculator.c
windows/makefile

index 81f30f1e6545c7e4af4ab4281fa9a4d31e33bf9b..badcd6eb0901583ba786b42d5f5a57eec237ffa8 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef HAVE_MALLOC_H
 #include <malloc.h>
+#endif
 #include <setjmp.h>
 #ifndef _WIN32
 #include <signal.h>
index 9f11d46d5a3ef53e763cff36efb8bd90e9a04e73..a0387f91954bcf7ff7f1f135a91ffe38c80abf64 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef HAVE_MALLOC_H
 #include <malloc.h>
+#endif
+#include <sys/types.h>
 
 #if UNIT_TESTING
 extern void* _test_malloc(const size_t size, const char* file, const int line);
index 803b26f49f5540ce34157a7f5109788891d439cb..42f273f89fa2cba071c02c01dfb7e5893710100a 100644 (file)
 
 // A calculator example used to demonstrate the cmockery testing library.
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include <assert.h>
+#ifdef HAVE_MALLOC_H
 #include <malloc.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 4d3e416634078ba398156fd86fc984b37f2dc30d..a6580f38a03cf81ffe3ca55b47286787e4509419 100644 (file)
@@ -53,7 +53,7 @@ EXAMPLE_SOURCE_DIRECTORY=..\src\example
 !ENDIF # EXAMPLE_SOURCE_DIRECTORY
 
 # Compiler flags and commands.
-CC_COMMAND=$(CC) /nologo /c /D_WIN32_WINNT=0x501 \
+CC_COMMAND=$(CC) /nologo /c /D_WIN32_WINNT=0x501 /DHAVE_MALLOC_H \
        /I$(LIBRARY_SOURCE_DIRECTORY)\google $(CFLAGS) $(**) /Fo$(@)
 CC_COMMAND_UNIT_TEST=$(CC_COMMAND) /DUNIT_TESTING=1 \
        /I$(EXAMPLE_SOURCE_DIRECTORY)