From 65f451d083e946cdee6278ebe8ffbc4705d9328b Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Thu, 2 Oct 2008 02:58:01 +0000 Subject: [PATCH] * gmalloc.c (__sbrk): Also define for uClibc. * s/gnu-linux.h (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Add definition for uClibc. --- src/ChangeLog | 7 +++++++ src/gmalloc.c | 10 +++++----- src/s/gnu-linux.h | 8 ++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index eb667c7a0ce..c4adaab887f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2008-10-02 Dan Nicolaescu + + * 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 * nsfont.m (nsfont_spec_to_traits): Use UnXX masks only for non-normal diff --git a/src/gmalloc.c b/src/gmalloc.c index 1cf9a8ee9b5..f1be37ba348 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -1706,17 +1706,17 @@ MA 02110-1301, USA. */ #include #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 extern __ptr_t __sbrk PP ((ptrdiff_t increment)); -#endif +#endif /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */ #ifndef NULL #define NULL 0 diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index bd0acd36302..2e28b81f7d0 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h @@ -156,11 +156,15 @@ along with GNU Emacs. If not, see . */ /* 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. */ -- 2.39.5