Commit dfb1d76f by Phil Edwards Committed by Benjamin Kosnik

configure.in: Check for gconv.h.


2000-10-25  Phil Edwards  <pme@sources.redhat.com>

        * configure.in:  Check for gconv.h.
        * libio/wfileops.c:  Wrap gconv.h in HAVE_GCONV_H.

        * config/c_io_libio_codecvt.c:  Change __mbstate_t to __c_mbstate_t.
        * libio/_G_config.h:  And here.
        * libio/iofwide.c:  And here.
        * libio/libio.h:  And here.

        * config/os/solaris/solaris2.7/bits/ctype_noninline.h:  Remove
          exception specification to match declaration.
        * include/bits/locale_facets.tcc:  Include bits/std_clocale.h.

From-SVN: r37053
parent dc5041ab
2000-10-25 Phil Edwards <pme@sources.redhat.com>
* configure.in: Check for gconv.h.
* libio/wfileops.c: Wrap gconv.h in HAVE_GCONV_H.
* config/c_io_libio_codecvt.c: Change __mbstate_t to __c_mbstate_t.
* libio/_G_config.h: And here.
* libio/iofwide.c: And here.
* libio/libio.h: And here.
* config/os/solaris/solaris2.7/bits/ctype_noninline.h: Remove
exception specification to match declaration.
* include/bits/locale_facets.tcc: Include bits/std_clocale.h.
2000-10-24 Mark Harig <mharig@landmark.com> 2000-10-24 Mark Harig <mharig@landmark.com>
* docs/configopts.html: Added documentation for the * docs/configopts.html: Added documentation for the
......
...@@ -624,6 +624,9 @@ ...@@ -624,6 +624,9 @@
/* Define if you have the <fp.h> header file. */ /* Define if you have the <fp.h> header file. */
#undef HAVE_FP_H #undef HAVE_FP_H
/* Define if you have the <gconv.h> header file. */
#undef HAVE_GCONV_H
/* Define if you have the <ieeefp.h> header file. */ /* Define if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H #undef HAVE_IEEEFP_H
......
...@@ -30,17 +30,17 @@ ...@@ -30,17 +30,17 @@
/* Prototypes of libio's codecvt functions. */ /* Prototypes of libio's codecvt functions. */
static enum __codecvt_result static enum __codecvt_result
do_out(struct _IO_codecvt *codecvt, __mbstate_t *statep, do_out(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end, const wchar_t *from_start, const wchar_t *from_end,
const wchar_t **from_stop, char *to_start, char *to_end, const wchar_t **from_stop, char *to_start, char *to_end,
char **to_stop); char **to_stop);
static enum __codecvt_result static enum __codecvt_result
do_unshift(struct _IO_codecvt *codecvt, __mbstate_t *statep, char *to_start, do_unshift(struct _IO_codecvt *codecvt, __c_mbstate_t *statep, char *to_start,
char *to_end, char **to_stop); char *to_end, char **to_stop);
static enum __codecvt_result static enum __codecvt_result
do_in(struct _IO_codecvt *codecvt, __mbstate_t *statep, do_in(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, const char **from_stop, const char *from_start, const char *from_end, const char **from_stop,
wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop); wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop);
...@@ -48,7 +48,7 @@ static int ...@@ -48,7 +48,7 @@ static int
do_encoding(struct _IO_codecvt *codecvt); do_encoding(struct _IO_codecvt *codecvt);
static int static int
do_length(struct _IO_codecvt *codecvt, __mbstate_t *statep, do_length(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, _IO_size_t max); const char *from_start, const char *from_end, _IO_size_t max);
static int static int
...@@ -72,7 +72,7 @@ struct _IO_codecvt __c_libio_codecvt = ...@@ -72,7 +72,7 @@ struct _IO_codecvt __c_libio_codecvt =
}; };
static enum __codecvt_result static enum __codecvt_result
do_out(struct _IO_codecvt *codecvt, __mbstate_t *statep, do_out(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end, const wchar_t *from_start, const wchar_t *from_end,
const wchar_t **from_stop, char *to_start, char *to_end, const wchar_t **from_stop, char *to_start, char *to_end,
char **to_stop) char **to_stop)
...@@ -97,7 +97,7 @@ do_out(struct _IO_codecvt *codecvt, __mbstate_t *statep, ...@@ -97,7 +97,7 @@ do_out(struct _IO_codecvt *codecvt, __mbstate_t *statep,
static enum __codecvt_result static enum __codecvt_result
do_unshift(struct _IO_codecvt *codecvt, __mbstate_t *statep, do_unshift(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
char *to_start, char *to_end, char **to_stop) char *to_start, char *to_end, char **to_stop)
{ {
*to_stop = to_start; *to_stop = to_start;
...@@ -106,7 +106,7 @@ do_unshift(struct _IO_codecvt *codecvt, __mbstate_t *statep, ...@@ -106,7 +106,7 @@ do_unshift(struct _IO_codecvt *codecvt, __mbstate_t *statep,
static enum __codecvt_result static enum __codecvt_result
do_in(struct _IO_codecvt *codecvt, __mbstate_t *statep, do_in(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, const char **from_stop, const char *from_start, const char *from_end, const char **from_stop,
wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop) wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop)
{ {
...@@ -140,7 +140,7 @@ do_always_noconv(struct _IO_codecvt *codecvt) ...@@ -140,7 +140,7 @@ do_always_noconv(struct _IO_codecvt *codecvt)
static int static int
do_length(struct _IO_codecvt *codecvt, __mbstate_t *statep, do_length(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, _IO_size_t max) const char *from_start, const char *from_end, _IO_size_t max)
{ return from_end - from_start; } { return from_end - from_start; }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
ctype<char>::ctype(const mask* __table = 0, bool __del = false, ctype<char>::ctype(const mask* __table = 0, bool __del = false,
size_t __refs = 0) throw() size_t __refs = 0)
: _Ctype_nois<char>(__refs), _M_del(__table != 0 && __del), : _Ctype_nois<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table) _M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table)
......
...@@ -18570,6 +18570,46 @@ EOF ...@@ -18570,6 +18570,46 @@ EOF
fi fi
for ac_hdr in gconv.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:18578: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 18583 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:18588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
fi fi
...@@ -18611,19 +18651,19 @@ fi ...@@ -18611,19 +18651,19 @@ fi
if test $ac_cv_header_locale_h = yes; then if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
echo "configure:18615: checking for LC_MESSAGES" >&5 echo "configure:18655: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'ac_cv_val_LC_MESSAGES'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 18620 "configure" #line 18660 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <locale.h> #include <locale.h>
int main() { int main() {
return LC_MESSAGES return LC_MESSAGES
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:18627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:18667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
ac_cv_val_LC_MESSAGES=yes ac_cv_val_LC_MESSAGES=yes
else else
...@@ -18660,14 +18700,14 @@ INTERFACE=v3 ...@@ -18660,14 +18700,14 @@ INTERFACE=v3
# Check for the interface version number for specifying where header # Check for the interface version number for specifying where header
# files are installed, if a version number is provided. # files are installed, if a version number is provided.
echo $ac_n "checking for interface version number""... $ac_c" 1>&6 echo $ac_n "checking for interface version number""... $ac_c" 1>&6
echo "configure:18664: checking for interface version number" >&5 echo "configure:18704: checking for interface version number" >&5
libstdcxx_interface=$INTERFACE libstdcxx_interface=$INTERFACE
echo "$ac_t""$libstdcxx_interface" 1>&6 echo "$ac_t""$libstdcxx_interface" 1>&6
# Process the option --with-gxx-include-dir=<path to include-files directory> # Process the option --with-gxx-include-dir=<path to include-files directory>
echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6 echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6
echo "configure:18671: checking for --with-gxx-include-dir" >&5 echo "configure:18711: checking for --with-gxx-include-dir" >&5
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given. # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
if test "${with_gxx_include_dir+set}" = set; then if test "${with_gxx_include_dir+set}" = set; then
withval="$with_gxx_include_dir" withval="$with_gxx_include_dir"
...@@ -18701,7 +18741,7 @@ fi ...@@ -18701,7 +18741,7 @@ fi
# Process the option "--enable-version-specific-runtime-libs" # Process the option "--enable-version-specific-runtime-libs"
echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6 echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6
echo "configure:18705: checking for --enable-version-specific-runtime-libs" >&5 echo "configure:18745: checking for --enable-version-specific-runtime-libs" >&5
# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given. # Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
if test "${enable_version_specific_runtime_libs+set}" = set; then if test "${enable_version_specific_runtime_libs+set}" = set; then
enableval="$enable_version_specific_runtime_libs" enableval="$enable_version_specific_runtime_libs"
......
...@@ -135,6 +135,7 @@ else ...@@ -135,6 +135,7 @@ else
GLIBCPP_CHECK_CTYPE GLIBCPP_CHECK_CTYPE
AC_FUNC_MMAP AC_FUNC_MMAP
AC_CHECK_HEADERS(gconv.h)
fi fi
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes) AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define _CPP_BITS_LOCFACETS_TCC 1 #define _CPP_BITS_LOCFACETS_TCC 1
#include <bits/std_cerrno.h> #include <bits/std_cerrno.h>
#include <bits/std_clocale.h> // For localeconv
#include <bits/std_cstdlib.h> // For strof, strtold #include <bits/std_cstdlib.h> // For strof, strtold
#include <bits/std_limits.h> // For numeric_limits #include <bits/std_limits.h> // For numeric_limits
#include <bits/std_memory.h> // For auto_ptr #include <bits/std_memory.h> // For auto_ptr
......
...@@ -37,15 +37,15 @@ typedef unsigned int wint_t; ...@@ -37,15 +37,15 @@ typedef unsigned int wint_t;
/* For use as part of glibc (native) or as part of libstdc++ (maybe /* For use as part of glibc (native) or as part of libstdc++ (maybe
not glibc) */ not glibc) */
#ifndef __mbstate_t_defined #ifndef __c_mbstate_t_defined
# define __mbstate_t_defined 1 # define __c_mbstate_t_defined 1
# ifdef _GLIBCPP_USE_WCHAR_T /*# ifdef _GLIBCPP_USE_WCHAR_T*/
typedef struct typedef struct
{ {
int count; int count;
wint_t value; wint_t value;
}__mbstate_t; }__c_mbstate_t;
# endif /*# endif*/
#endif #endif
#undef __need_mbstate_t #undef __need_mbstate_t
...@@ -56,13 +56,13 @@ typedef size_t _G_size_t; ...@@ -56,13 +56,13 @@ typedef size_t _G_size_t;
typedef struct typedef struct
{ {
__off_t __pos; __off_t __pos;
__mbstate_t __state; __c_mbstate_t __state;
} _G_fpos_t; } _G_fpos_t;
typedef struct typedef struct
{ {
__off64_t __pos; __off64_t __pos;
__mbstate_t __state; __c_mbstate_t __state;
} _G_fpos64_t; } _G_fpos64_t;
#else #else
typedef __off_t _G_fpos_t; typedef __off_t _G_fpos_t;
......
...@@ -41,22 +41,22 @@ ...@@ -41,22 +41,22 @@
/* Prototypes of libio's codecvt functions. */ /* Prototypes of libio's codecvt functions. */
static enum __codecvt_result do_out (struct _IO_codecvt *codecvt, static enum __codecvt_result do_out (struct _IO_codecvt *codecvt,
__mbstate_t *statep, __c_mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_start,
const wchar_t *from_end, const wchar_t *from_end,
const wchar_t **from_stop, char *to_start, const wchar_t **from_stop, char *to_start,
char *to_end, char **to_stop); char *to_end, char **to_stop);
static enum __codecvt_result do_unshift (struct _IO_codecvt *codecvt, static enum __codecvt_result do_unshift (struct _IO_codecvt *codecvt,
__mbstate_t *statep, char *to_start, __c_mbstate_t *statep, char *to_start,
char *to_end, char **to_stop); char *to_end, char **to_stop);
static enum __codecvt_result do_in (struct _IO_codecvt *codecvt, static enum __codecvt_result do_in (struct _IO_codecvt *codecvt,
__mbstate_t *statep, __c_mbstate_t *statep,
const char *from_start, const char *from_start,
const char *from_end, const char *from_end,
const char **from_stop, wchar_t *to_start, const char **from_stop, wchar_t *to_start,
wchar_t *to_end, wchar_t **to_stop); wchar_t *to_end, wchar_t **to_stop);
static int do_encoding (struct _IO_codecvt *codecvt); static int do_encoding (struct _IO_codecvt *codecvt);
static int do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep, static int do_length (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_start,
const char *from_end, _IO_size_t max); const char *from_end, _IO_size_t max);
static int do_max_length (struct _IO_codecvt *codecvt); static int do_max_length (struct _IO_codecvt *codecvt);
...@@ -116,8 +116,8 @@ _IO_fwide (fp, mode) ...@@ -116,8 +116,8 @@ _IO_fwide (fp, mode)
struct gconv_fcts fcts; struct gconv_fcts fcts;
/* Clear the state. We start all over again. */ /* Clear the state. We start all over again. */
memset (&fp->_wide_data->_IO_state, '\0', sizeof (__mbstate_t)); memset (&fp->_wide_data->_IO_state, '\0', sizeof (__c_mbstate_t));
memset (&fp->_wide_data->_IO_last_state, '\0', sizeof (__mbstate_t)); memset (&fp->_wide_data->_IO_last_state, '\0', sizeof (__c_mbstate_t));
__wcsmbs_clone_conv (&fcts); __wcsmbs_clone_conv (&fcts);
...@@ -188,7 +188,7 @@ weak_alias (_IO_fwide, fwide) ...@@ -188,7 +188,7 @@ weak_alias (_IO_fwide, fwide)
static enum __codecvt_result static enum __codecvt_result
do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep, do_out (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end, const wchar_t *from_start, const wchar_t *from_end,
const wchar_t **from_stop, char *to_start, char *to_end, const wchar_t **from_stop, char *to_start, char *to_end,
char **to_stop) char **to_stop)
...@@ -257,7 +257,7 @@ do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep, ...@@ -257,7 +257,7 @@ do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep,
static enum __codecvt_result static enum __codecvt_result
do_unshift (struct _IO_codecvt *codecvt, __mbstate_t *statep, do_unshift (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
char *to_start, char *to_end, char **to_stop) char *to_start, char *to_end, char **to_stop)
{ {
enum __codecvt_result result; enum __codecvt_result result;
...@@ -318,7 +318,7 @@ do_unshift (struct _IO_codecvt *codecvt, __mbstate_t *statep, ...@@ -318,7 +318,7 @@ do_unshift (struct _IO_codecvt *codecvt, __mbstate_t *statep,
static enum __codecvt_result static enum __codecvt_result
do_in (struct _IO_codecvt *codecvt, __mbstate_t *statep, do_in (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, const char **from_stop, const char *from_start, const char *from_end, const char **from_stop,
wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop) wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop)
{ {
...@@ -416,7 +416,7 @@ do_always_noconv (struct _IO_codecvt *codecvt) ...@@ -416,7 +416,7 @@ do_always_noconv (struct _IO_codecvt *codecvt)
static int static int
do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep, do_length (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, _IO_size_t max) const char *from_start, const char *from_end, _IO_size_t max)
{ {
int result; int result;
......
...@@ -206,22 +206,22 @@ struct _IO_codecvt ...@@ -206,22 +206,22 @@ struct _IO_codecvt
{ {
void (*__codecvt_destr) (struct _IO_codecvt *); void (*__codecvt_destr) (struct _IO_codecvt *);
enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *, enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *,
__mbstate_t *, __c_mbstate_t *,
const wchar_t *, const wchar_t *,
const wchar_t *, const wchar_t *,
const wchar_t **, char *, const wchar_t **, char *,
char *, char **); char *, char **);
enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *, enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *,
__mbstate_t *, char *, __c_mbstate_t *, char *,
char *, char **); char *, char **);
enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *, enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *,
__mbstate_t *, __c_mbstate_t *,
const char *, const char *, const char *, const char *,
const char **, wchar_t *, const char **, wchar_t *,
wchar_t *, wchar_t **); wchar_t *, wchar_t **);
int (*__codecvt_do_encoding) (struct _IO_codecvt *); int (*__codecvt_do_encoding) (struct _IO_codecvt *);
int (*__codecvt_do_always_noconv) (struct _IO_codecvt *); int (*__codecvt_do_always_noconv) (struct _IO_codecvt *);
int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *, int (*__codecvt_do_length) (struct _IO_codecvt *, __c_mbstate_t *,
const char *, const char *, _IO_size_t); const char *, const char *, _IO_size_t);
int (*__codecvt_do_max_length) (struct _IO_codecvt *); int (*__codecvt_do_max_length) (struct _IO_codecvt *);
...@@ -247,8 +247,8 @@ struct _IO_wide_data ...@@ -247,8 +247,8 @@ struct _IO_wide_data
wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */ wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
__mbstate_t _IO_state; __c_mbstate_t _IO_state;
__mbstate_t _IO_last_state; __c_mbstate_t _IO_last_state;
#endif #endif
struct _IO_codecvt _codecvt; struct _IO_codecvt _codecvt;
......
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
#include <assert.h> #include <assert.h>
#include <libioP.h> #include <libioP.h>
#include <wchar.h> #include <wchar.h>
#include <gconv.h> #ifdef HAVE_GCONV_H
# include <gconv.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment