From 8ebc26da26b973322b5614650d3fb97da60b19ce Mon Sep 17 00:00:00 2001 From: John Marino Date: Tue, 24 Sep 2013 14:39:59 +0000 Subject: [PATCH] lang/gnat-aux: Support iconv update in DragonFly master branch This update affects dragonfly only, and supports the updated ctypes in the DragonFly master branch. --- lang/gnat-aux/files/diff-cxx | 46 ++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/lang/gnat-aux/files/diff-cxx b/lang/gnat-aux/files/diff-cxx index 0b575453e3dd..91500d6afcad 100644 --- a/lang/gnat-aux/files/diff-cxx +++ b/lang/gnat-aux/files/diff-cxx @@ -579,7 +579,7 @@ +} --- /dev/null +++ libstdc++-v3/config/os/bsd/dragonfly/ctype_base.h -@@ -0,0 +1,60 @@ +@@ -0,0 +1,75 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000, 2003, 2009, 2010 Free Software Foundation, Inc. @@ -609,8 +609,6 @@ +// + +// Information as gleaned from /usr/include/ctype.h on DragonFly. -+// Full details can be found from git repo at: -+// http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/ctype.h + +namespace std _GLIBCXX_VISIBILITY(default) +{ @@ -624,6 +622,22 @@ + + // NB: Offsets into ctype::_M_table force a particular size + // on the mask type. Because of this, we don't use an enum. ++#ifdef _CTYPE_S ++ // DragonFly 3.6 and later ++ typedef unsigned long mask; ++ static const mask upper = _CTYPE_U; ++ static const mask lower = _CTYPE_L; ++ static const mask alpha = _CTYPE_A; ++ static const mask digit = _CTYPE_D; ++ static const mask xdigit = _CTYPE_X; ++ static const mask space = _CTYPE_S; ++ static const mask print = _CTYPE_R; ++ static const mask graph = _CTYPE_A | _CTYPE_D | _CTYPE_P; ++ static const mask cntrl = _CTYPE_C; ++ static const mask punct = _CTYPE_P; ++ static const mask alnum = _CTYPE_A | _CTYPE_D; ++#else ++ // DragonFly 3.4 and older + typedef uint16_t mask; + static const mask upper = _CTYPEMASK_U; + static const mask lower = _CTYPEMASK_L; @@ -636,13 +650,14 @@ + static const mask cntrl = _CTYPEMASK_C; + static const mask punct = _CTYPEMASK_P; + static const mask alnum = _CTYPEMASK_A | _CTYPEMASK_D; ++#endif + }; + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace --- /dev/null +++ libstdc++-v3/config/os/bsd/dragonfly/ctype_inline.h -@@ -0,0 +1,127 @@ +@@ -0,0 +1,144 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000, 2003, 2004, 2005, 2009, 2010 @@ -721,7 +736,11 @@ + ctype:: + do_is(mask __m, wchar_t __c) const + { ++#ifdef _CTYPE_S ++ return __istype (__c, __m); ++#else + return __libc_ctype_ [__c + 1] & __m; ++#endif + } + + inline const wchar_t* @@ -729,6 +748,10 @@ + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const + { + for (; __lo < __hi; ++__vec, ++__lo) ++#ifdef _CTYPE_S ++ *__vec = __maskrune (*__lo, upper | lower | alpha | digit | xdigit ++ | space | print | graph | cntrl | punct | alnum); ++#else + { + mask __m = 0; + if (isupper (*__lo)) __m |= _CTYPEMASK_U; @@ -746,6 +769,7 @@ + + *__vec = __m; + } ++#endif + return __hi; + } + @@ -753,7 +777,11 @@ + ctype:: + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const + { ++#ifdef _CTYPE_S ++ while (__lo < __hi && ! __istype (*__lo, __m)) ++#else + while (__lo < __hi && !(__libc_ctype_ [*__lo + 1] & __m)) ++#endif + ++__lo; + return __lo; + } @@ -762,7 +790,11 @@ + ctype:: + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const + { ++#ifdef _CTYPE_S ++ while (__lo < __hi && __istype (*__lo, __m)) ++#else + while (__lo < __hi && (__libc_ctype_ [*__lo + 1] & __m)) ++#endif + ++__lo; + return __lo; + } @@ -772,7 +804,7 @@ +} // namespace --- /dev/null +++ libstdc++-v3/config/os/bsd/dragonfly/ctype_noninline.h -@@ -0,0 +1,94 @@ +@@ -0,0 +1,98 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010 @@ -809,7 +841,11 @@ + +// Information as gleaned from /usr/include/ctype.h + ++#ifdef _CTYPE_S ++ extern "C" const unsigned long __libc_C_ctype_[]; ++#else + extern "C" const __uint16_t __libc_C_ctype_[]; ++#endif + + const ctype_base::mask* + ctype::classic_table() throw()