This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] Update newlib so that it passes libc++'s tests
- From: JF Bastien <jfb at chromium dot org>
- To: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Cc: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Wed, 18 Dec 2013 16:32:47 -0500
- Subject: Re: [PATCH] Update newlib so that it passes libc++'s tests
- Authentication-results: sourceware.org; auth=none
- References: <CABdywOcnSpU=r5NGDDzhea4gxALh8LRL4A9vRY31wFjLhtF5zA at mail dot gmail dot com> <52B004C8 dot 9080106 at embedded-brains dot de>
> Recent GCC have built-in defines:
>
> #define __WCHAR_TYPE__ long int
> #define __WCHAR_MAX__ 2147483647L
> #define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
>
> Maybe we can use them if available. Does LLVM also provide such built-in
> defines?
My fix uses __WCHAR_MAX__ and __WCHAR_MIN__ if available. Yes, both
GCC and LLVM have them (rather, LLVM has __WCHAR_MAX__,
__WCHAR_TYPE__, __WCHAR_WIDTH__ and __WCHAR_UNSIGNED__, and its
stdint.h has WCHAR_MAX and WCHAR_MIN definitions based on these).