changeset 98455:876b289a899e

* gmalloc.c (__sbrk): Also define for uClibc. * s/gnu-linux.h (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Add definition for uClibc.
author Dan Nicolaescu <dann@ics.uci.edu>
date Thu, 02 Oct 2008 02:58:01 +0000
parents 431a14612b87
children a68b7a895cb6
files src/ChangeLog src/gmalloc.c src/s/gnu-linux.h
diffstat 3 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Oct 02 00:49:49 2008 +0000
+++ b/src/ChangeLog	Thu Oct 02 02:58:01 2008 +0000
@@ -1,3 +1,10 @@
+2008-10-02  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* gmalloc.c (__sbrk): Also define for uClibc.
+
+	* s/gnu-linux.h (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Add definition
+	for uClibc.
+
 2008-10-01  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
 	* nsfont.m (nsfont_spec_to_traits): Use UnXX masks only for non-normal
--- a/src/gmalloc.c	Thu Oct 02 00:49:49 2008 +0000
+++ b/src/gmalloc.c	Thu Oct 02 02:58:01 2008 +0000
@@ -1706,17 +1706,17 @@
 #include <malloc.h>
 #endif
 
-#ifndef	__GNU_LIBRARY__
+/* uClibc defines __GNU_LIBRARY__, but it is not completely
+   compatible.  */
+#if !defined(__GNU_LIBRARY__) || defined(__UCLIBC__)
 #define	__sbrk	sbrk
-#endif
-
-#ifdef __GNU_LIBRARY__
+#else /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */
 /* It is best not to declare this and cast its result on foreign operating
    systems with potentially hostile include files.  */
 
 #include <stddef.h>
 extern __ptr_t __sbrk PP ((ptrdiff_t increment));
-#endif
+#endif /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */
 
 #ifndef NULL
 #define NULL 0
--- a/src/s/gnu-linux.h	Thu Oct 02 00:49:49 2008 +0000
+++ b/src/s/gnu-linux.h	Thu Oct 02 02:58:01 2008 +0000
@@ -156,11 +156,15 @@
 /* new C libio names */
 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
   ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
-#else /* !_IO_STDIO_H */
+#elif defined (__UCLIBC__)
+/* using the uClibc library */
+#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
+  ((FILE)->__bufpos - (FILE)->__bufstart)
+#else /* !_IO_STDIO_H && ! __UCLIBC__ */
 /* old C++ iostream names */
 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
   ((FILE)->_pptr - (FILE)->_pbase)
-#endif /* !_IO_STDIO_H */
+#endif /* !_IO_STDIO_H && ! __UCLIBC__ */
 #endif /* emacs */
 
 /* Ask GCC where to find libgcc.a.  */