bearxuqian / cmockery

Automatically exported from code.google.com/p/cmockery
0 stars 0 forks source link

malloc.h not found on Mac OS Leopard #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
stevej your patch would be appreciated, where is it?

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

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
This will be integrated into cmockery release 0.1.3.

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

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Any word on 0.1.3?

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