Skip to content

ricoh2_buffer: fix malloc header location on macOS

Caleb Xu requested to merge alebcay/backends:macos-malloc-fix into master

Building sane-backends version 1.0.28 on macOS produces the following error:

/bin/sh ../libtool --silent  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I../include/sane  -DPATH_SANE_CONFIG_DIR=/usr/local/Cellar/sane-backends/1.0.28/etc/sane.d 	  -DPATH_SANE_DATA_DIR=/usr/local/Cellar/sane-backends/1.0.28/share 	  -DPATH_SANE_LOCK_DIR=/usr/local/var/lock/sane 	  -DV_MAJOR=1 -DV_MINOR=0 -I. -I. -I../include -I../include -I/usr/local/Cellar/libusb/1.0.22/include/libusb-1.0 -DLIBDIR="\"/usr/local/Cellar/sane-backends/1.0.28/lib/sane\"" -DBACKEND_NAME=ricoh2  -Wall -g -O2 -c -o libricoh2_la-ricoh2.lo `test -f 'ricoh2.c' || echo './'`ricoh2.c
In file included from ricoh2.c:56:
./ricoh2_buffer.c:49:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [libricoh2_la-ricoh2.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1

The underlying issue seems to be that malloc resides at malloc/malloc.h on macOS instead of just malloc.h. This merge request directs ricoh2_buffer.c to look for malloc at the correct header file location on macOS.

Merge request reports