timejson.c fails to compile on FreeBSD
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenSRF |
New
|
Undecided
|
Unassigned |
Bug Description
timejson.c includes <malloc.h>. FreeBSD declares the prototypes for malloc(), et al in stdlib.h.
Patch attached.
Without the patch, the following behaviour is observed:
# uname -srp
FreeBSD 8.3-STABLE amd64
# pwd
/home/opensrf/
# autoreconf -i
...
# CFLAGS=
--sysconfdir=
--with-
...
# gmake
...
In file included from timejson.c:8:
/usr/include/
gmake[2]: *** [timejson.o] Error 1
gmake[2]: Leaving directory `/usr/home/
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/home/
gmake: *** [all-recursive] Error 1
# cat -n src/c-apps/
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <stdarg.h>
5 #include <time.h>
6 #include <sys/time.h>
7 #include <sys/resource.h>
8 #include <malloc.h>
9 #include "opensrf/utils.h"
10 #include "opensrf/
#
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Signed-off-by:
Jim Long
<email address hidden>
Jim,
I liked the patch that you sent me privately better, the one where you checked if __STDC__ was defined. Could you add that one to this bug as well?
Thanks,
Jason