This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
[ob/fix] libc/stdio/fread.c: Include malloc.h
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sources dot redhat dot com
- Date: Fri, 24 Sep 2004 11:14:18 +0200
- Subject: [ob/fix] libc/stdio/fread.c: Include malloc.h
- Reply-to: newlib at sources dot redhat dot com
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
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.