This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ob/fix] libc/stdio/fread.c: Include malloc.h


Corinna Vinschen wrote:
Hi,

the latest patch to fread.c uses FREEUB.  This is defined in
libc/stdio/local.h and calls _free_r().  _free_r doesn't exist on
Cygwin and is therefore defined as free in stdlib.h as well as in
malloc.h.  Unfortunately, none of these files is included in
fread.c, nor in local.h so this patch breaks Cygwin.

I've applied the obvious fix below.  Perhaps, long-term it would
be better to include stdlib.h or malloc.h in local.h.


Corinna


* libc/stdio/fread.c (fread): Include <malloc.h>.

Index: libc/stdio/fread.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fread.c,v
retrieving revision 1.6
diff -p -u -r1.6 fread.c
--- libc/stdio/fread.c 22 Sep 2004 21:22:07 -0000 1.6
+++ libc/stdio/fread.c 24 Sep 2004 09:07:08 -0000
@@ -58,6 +58,7 @@ Supporting OS subroutines required: <<cl
#include <_ansi.h>
#include <stdio.h>
#include <string.h>
+#include <malloc.h>
#include "local.h"
#ifdef __SCLE



My bad. I actually had the fix in "local.h" but neglected to check it in with the fread.c fix.


-- Jeff J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]