zylishiyu/cmockery

malloc.h not found on Mac OS Leopard

Opened this issue · 10 comments

What steps will reproduce the problem?
1. Compile cmockery on Mac OS Leopard

What is the expected output? What do you see instead?
When running "./configure && make", it errors out saying that "malloc.h" can 
not be found (log 
attached as "plain-configure.log"). On Mac OS there are at least 3 different 
"malloc.h" files:

$ find /usr/include -name "malloc.h"
/usr/include/malloc/malloc.h
/usr/include/objc/malloc.h
/usr/include/sys/malloc.h

 Apparently "/usr/include/sys/malloc.h" is the one to use. Thus I attempted to compile cmockery 
by issueing the following command:

"CFLAGS="-I/usr/include/sys" ./configure && make

That got me further, but size_t does not appear to be defined.
According to stdlib.h, size_t is defined as:
typedef __darwin_size_t size_t;

Output of the build process is attached as "cflags-configure.log".

What version of the product are you using? On what operating system?
cmockery 0.1.2, Mac OS Leopard (10.5.4)


Original issue reported on code.google.com by sebnow@gmail.com on 14 Oct 2008 at 1:00

Attachments:

I just found someone's post on the group about the same problem[0]. It turns 
out /usr/include/malloc/malloc.h 
is the proper malloc.h. Compiling cmockery using that header works fine.

[0] 
http://groups.google.com/group/cmockery/browse_thread/thread/046ac9d8189760a4

Original comment by sebnow@gmail.com on 14 Oct 2008 at 3:31

There's a better way which I have a patch for and am going to submit it for 
code review.

Original comment by ste...@gmail.com on 28 Jan 2009 at 5:22

stevej your patch would be appreciated, where is it?

Original comment by stewarta...@gmail.com on 10 Apr 2009 at 6:59

Original comment by stewarta...@gmail.com on 10 Apr 2009 at 9:43

I don't have a configuration to reproduce this.  If someone sends me a patch 
I'll 
integrate the fix.

Original comment by stewarta...@gmail.com on 10 Apr 2009 at 9:45

Since you're using configure which is testing for malloc.h, I've attached a 
patch that gets 
this to build on Mac OS X 10.5.7 (Xcode 3.1.2) with HAVE_MALLOC_H.  Note that I 
also 
added an include for sys/types.h to get size_t in src/example/allocate_module.c.

Original comment by wit...@pobox.com on 31 May 2009 at 9:35

Attachments:

Original comment by stewarta...@gmail.com on 6 Jul 2009 at 7:34

This will be integrated into cmockery release 0.1.3.

Original comment by stewarta...@gmail.com on 7 Jul 2009 at 7:43

Original comment by stewarta...@gmail.com on 7 Jul 2009 at 7:51

  • Changed state: Started
Any word on 0.1.3?

Original comment by fla...@gmail.com on 11 Mar 2012 at 3:20