This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: WCHAR_MIN; WCHAR_MAX


Benjamin Kosnik <bkoz@cygnus.com> writes:

> Are you saying that
> autoconf/fixincludes  should test for what?

For now there should be autoconf tests.  At the same time someone
might want to add something to fixincludes to help saving the
situation.  On Solaris 7 machines (at least) the definitions are
present (in wchar.h) so it iis obvious what fixincludes has to add.

> Even if it does test for this, we'll run into problems on platforms
> where wchar_t is not a simple integer type, because mknumeric_limits
> is trying to probe the basic types to determine largest size, etc
> for the <limits> header.  All kinds of funky stuff goes on in there.

If some platform make wchar_t no integer type it is broken beyond
belief and we should not even think about supporting it.  I don't know
who ever could be so stupid (though I never saw was M$ is doing).

> Or, are you saying that autoconf should test for something more complex?
> And if so, what? This is our current test for mbstate_t (in configure.in)
> 
> # Test wchar.h for mbstate_t, which is needed for char_traits and others.
> AC_CHECK_HEADER(wchar.h, [
> AC_TRY_COMPILE([#include <wchar.h>],
> [mbstate_t teststate;], use_native_mbstatet=yes, use_native_mbstatet=no)])
> if test $use_native_mbstatet = "no"; then
>   AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
>   AC_MSG_WARN("standard header wchar.h does not declare the type
> mbstate_t")
> fi

And that's fine.  Just add some for WCHAR_MIN etc.


Alternatively require using using the versions of the OSes which have
the necessary definitions or fixincludes cleans up the mess.  I would
prefer this since it's much cleaner.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

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