summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-29 21:52:54 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-29 21:52:54 +0000
commit983211d418cdaf8e183831d4d409cf935bc5d22f (patch)
treeb3dfb2ce5894e4bea6195cc2d125b15eda8bc7d0 /libstdc++-v3
parent7390093773604075153cd930dc85c47c1cc1e367 (diff)
downloadgcc-983211d418cdaf8e183831d4d409cf935bc5d22f.tar.gz
* config/c_io_libio.cc (basic_file<char>::__basic_file):
Don't pass a NULL _IO_wide_data to _IO_no_init when _GLIBCPP_USE_WCHAR_T is not defined. * config/c_io_libio.h (_IO_codecvt): Don't declare when _GLIBCPP_USE_WCHAR_T is not defined. * config/c_io_libio_codecvt.c: Don't compile it when _GLIBCPP_USE_WCHAR_T is not defined. * include/bits/codecvt.h (codecvt<_InternT, _ExternT, __enc_traits): Don't define this specialization when _GLIBCPP_USE_WCHAR_T is not defined. * include/bits/locale_facets.h (<bits/std_cwctype.h>): Don't include it when _GLIBCPP_USE_WCHAR_T is not defined. * src/codecvt.cc (__enc_traits::_S_max_size): Don't define when _GLIBCPP_USE_WCHAR_T is not defined. * src/localename.cc (locale::_Impl::_M_construct_collate): Don't call wide-character functions when _GLIBCPP_USE_WCHAR_T is not defined. (locale::_Impl::_M_construct_ctype): Likewise. (locale::_Impl::_M_construct_monetary): Likewise. (locale::_Impl::_M_construct_numeric): Likewise. (locale::_Impl::_M_construct_time): Likewise. (locale::_Impl::_M_construct_messages): Likewise. * iofopen.c (_IO_new_fopen): Don't define `_IO_wide_data wd' if _GLIBCPP_USE_WCHAR_T is not defined. * iofwide.c: Don't define codecvt functions when _GLIBCPP_USE_WCHAR_T is not defined. (_IO_fwide): Don't try to put the stream in wide mode when _GLIBCPP_USE_WCHAR_T is not defined. * libio.h (_IO_wide_data): Define it as an incomplete struct when _GLIBCPP_USE_WCHAR_T is not defined. * wfiledoalloc.c: Don't define anything when _GLIBCPP_USE_WCHAR_T is not defined. * wfileops.c: Likewise. * wgenops.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37131 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog25
-rw-r--r--libstdc++-v3/config/c_io_libio.cc4
-rw-r--r--libstdc++-v3/config/c_io_libio.h2
-rw-r--r--libstdc++-v3/config/c_io_libio_codecvt.c3
-rw-r--r--libstdc++-v3/include/bits/codecvt.h2
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h2
-rw-r--r--libstdc++-v3/libio/ChangeLog13
-rw-r--r--libstdc++-v3/libio/iofopen.c2
-rw-r--r--libstdc++-v3/libio/iofwide.c11
-rw-r--r--libstdc++-v3/libio/libio.h8
-rw-r--r--libstdc++-v3/libio/wfiledoalloc.c3
-rw-r--r--libstdc++-v3/libio/wfileops.c3
-rw-r--r--libstdc++-v3/libio/wgenops.c3
-rw-r--r--libstdc++-v3/src/codecvt.cc2
-rw-r--r--libstdc++-v3/src/localename.cc26
15 files changed, 105 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index efe4291224e..6b4d2af8e24 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,6 +1,29 @@
2000-10-29 Mark Mitchell <mark@codesourcery.com>
- * acinclue.m4 (GLIBCPP_ENABLE_ATOMICITY): Handle IRIX.
+ * config/c_io_libio.cc (basic_file<char>::__basic_file):
+ Don't pass a NULL _IO_wide_data to _IO_no_init when
+ _GLIBCPP_USE_WCHAR_T is not defined.
+ * config/c_io_libio.h (_IO_codecvt): Don't declare when
+ _GLIBCPP_USE_WCHAR_T is not defined.
+ * config/c_io_libio_codecvt.c: Don't compile it
+ when _GLIBCPP_USE_WCHAR_T is not defined.
+ * include/bits/codecvt.h (codecvt<_InternT, _ExternT, __enc_traits):
+ Don't define this specialization when _GLIBCPP_USE_WCHAR_T
+ is not defined.
+ * include/bits/locale_facets.h (<bits/std_cwctype.h>): Don't
+ include it when _GLIBCPP_USE_WCHAR_T is not defined.
+ * src/codecvt.cc (__enc_traits::_S_max_size): Don't define
+ when _GLIBCPP_USE_WCHAR_T is not defined.
+ * src/localename.cc (locale::_Impl::_M_construct_collate):
+ Don't call wide-character functions when _GLIBCPP_USE_WCHAR_T is
+ not defined.
+ (locale::_Impl::_M_construct_ctype): Likewise.
+ (locale::_Impl::_M_construct_monetary): Likewise.
+ (locale::_Impl::_M_construct_numeric): Likewise.
+ (locale::_Impl::_M_construct_time): Likewise.
+ (locale::_Impl::_M_construct_messages): Likewise.
+
+ * acinclude.m4 (GLIBCPP_ENABLE_ATOMICITY): Handle IRIX.
* aclocal.m4: Regenerated.
* configure: Likewise.
* config/os/irix/bits/atomicity.h: New file.
diff --git a/libstdc++-v3/config/c_io_libio.cc b/libstdc++-v3/config/c_io_libio.cc
index 9712d264ed9..8c465ae8fc5 100644
--- a/libstdc++-v3/config/c_io_libio.cc
+++ b/libstdc++-v3/config/c_io_libio.cc
@@ -204,7 +204,11 @@ namespace std {
_lock = __lock;
#endif
// Don't set the orientation of the stream when initializing.
+#ifdef _GLIBCPP_USE_WCHAR_T
_IO_no_init(this, 0, 0, &_M_wfile, 0);
+#else /* !defined(_GLIBCPP_USE_WCHAR_T) */
+ _IO_no_init(this, 0, 0, NULL, 0);
+#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
_IO_JUMPS((_IO_FILE_plus *) this) = &_IO_file_jumps;
_IO_file_init((_IO_FILE_plus*)this);
}
diff --git a/libstdc++-v3/config/c_io_libio.h b/libstdc++-v3/config/c_io_libio.h
index d14ec5c352f..c26b3c9fa56 100644
--- a/libstdc++-v3/config/c_io_libio.h
+++ b/libstdc++-v3/config/c_io_libio.h
@@ -62,7 +62,9 @@ namespace std {
typedef _IO_FILE __c_file_type;
typedef _IO_wide_data __c_wfile_type;
+#ifdef _GLIBCPP_USE_WCHAR_T
extern "C" _IO_codecvt __c_libio_codecvt;
+#endif /* defined (_GLIBCPP_USE_WCHAR_T) */
// from ios_base.h
struct __ios_flags
diff --git a/libstdc++-v3/config/c_io_libio_codecvt.c b/libstdc++-v3/config/c_io_libio_codecvt.c
index 4fc7fc0cf00..38d8b55e0c2 100644
--- a/libstdc++-v3/config/c_io_libio_codecvt.c
+++ b/libstdc++-v3/config/c_io_libio_codecvt.c
@@ -27,6 +27,7 @@
#include <libio.h>
+#ifdef _GLIBCPP_USE_WCHAR_T
/* Prototypes of libio's codecvt functions. */
static enum __codecvt_result
@@ -148,3 +149,5 @@ do_length(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
static int
do_max_length(struct _IO_codecvt *codecvt)
{ return 1; }
+
+#endif /* _GLIBCPP_USE_WCHAR_T */
diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h
index 148bebc20c6..738d5af3678 100644
--- a/libstdc++-v3/include/bits/codecvt.h
+++ b/libstdc++-v3/include/bits/codecvt.h
@@ -303,6 +303,7 @@ namespace std
template<typename _InternT, typename _ExternT, typename _StateT>
locale::id codecvt<_InternT, _ExternT, _StateT>::id;
+#ifdef _GLIBCPP_USE_WCHAR_T
// partial specialization
// This specialization takes advantage of iconv to provide code
// conversions between a large number of character encodings.
@@ -567,6 +568,7 @@ namespace std
do_max_length() const throw()
{ return 1; }
#endif
+#endif /* _GLIBCPP_USE_WCHAR_T */
// codecvt<char, char, mbstate_t> required specialization
template<>
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index ea651307fb3..6525bda6dc8 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -39,7 +39,9 @@
#include <bits/std_ctime.h> // For struct tm
#include <typeinfo> // For bad_cast, which shouldn't be here.
#include <bits/std_ios.h> // For ios_base
+#ifdef _GLIBCPP_USE_WCHAR_T
#include <bits/std_cwctype.h> // For wctype_t
+#endif /* _GLIBCPP_USE_WCHAR_T */
namespace std
{
diff --git a/libstdc++-v3/libio/ChangeLog b/libstdc++-v3/libio/ChangeLog
index f4e7664df7e..dd21399d951 100644
--- a/libstdc++-v3/libio/ChangeLog
+++ b/libstdc++-v3/libio/ChangeLog
@@ -1,5 +1,18 @@
2000-10-29 Mark Mitchell <mark@codesourcery.com>
+ * iofopen.c (_IO_new_fopen): Don't define `_IO_wide_data wd'
+ if _GLIBCPP_USE_WCHAR_T is not defined.
+ * iofwide.c: Don't define codecvt functions when
+ _GLIBCPP_USE_WCHAR_T is not defined.
+ (_IO_fwide): Don't try to put the stream in wide mode when
+ _GLIBCPP_USE_WCHAR_T is not defined.
+ * libio.h (_IO_wide_data): Define it as an incomplete struct
+ when _GLIBCPP_USE_WCHAR_T is not defined.
+ * wfiledoalloc.c: Don't define anything when
+ _GLIBCPP_USE_WCHAR_T is not defined.
+ * wfileops.c: Likewise.
+ * wgenops.c: Likewise.
+
* _G_config.h (_G_USING_THUNKS): Allow overrides from
OS-configuration files.
* libioP.h: Test _G_USING_THUNKS with #if, rather than #ifdef.
diff --git a/libstdc++-v3/libio/iofopen.c b/libstdc++-v3/libio/iofopen.c
index f34fd1e5152..2dcdee0235c 100644
--- a/libstdc++-v3/libio/iofopen.c
+++ b/libstdc++-v3/libio/iofopen.c
@@ -44,7 +44,9 @@ _IO_new_fopen (filename, mode)
#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
#endif
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
struct _IO_wide_data wd;
+#endif /* !(defined _LIBC || defined _GLIBCPP_USE_WCHAR_T) */
} *new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
diff --git a/libstdc++-v3/libio/iofwide.c b/libstdc++-v3/libio/iofwide.c
index 0ec1182b4ff..76a20ce3fb4 100644
--- a/libstdc++-v3/libio/iofwide.c
+++ b/libstdc++-v3/libio/iofwide.c
@@ -38,7 +38,7 @@
# include <langinfo.h>
#endif
-
+#ifdef _GLIBCPP_USE_WCHAR_T
/* Prototypes of libio's codecvt functions. */
static enum __codecvt_result do_out (struct _IO_codecvt *codecvt,
__c_mbstate_t *statep,
@@ -83,7 +83,7 @@ static struct __gconv_trans_data libio_translit =
.__trans_fct = __gconv_transliterate
};
#endif
-
+#endif /* defined(GLIBCPP_USE_WCHAR_T) */
/* Return orientation of stream. If mode is nonzero try to change
the orientation first. */
@@ -104,6 +104,7 @@ _IO_fwide (fp, mode)
/* Set the orientation appropriately. */
if (mode > 0)
{
+#ifdef _GLIBCPP_USE_WCHAR_T
struct _IO_codecvt *cc = fp->_codecvt;
fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end;
@@ -174,6 +175,9 @@ _IO_fwide (fp, mode)
/* From now on use the wide character callback functions. */
((struct _IO_FILE_plus *) fp)->vtable = fp->_wide_data->_wide_vtable;
+#else /* !defined(_GLIBCPP_USE_WCHAR_T) */
+ mode = fp->_mode;
+#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
}
/* Set the mode now. */
@@ -186,6 +190,7 @@ _IO_fwide (fp, mode)
weak_alias (_IO_fwide, fwide)
#endif
+#ifdef _GLIBCPP_USE_WCHAR_T
static enum __codecvt_result
do_out (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
@@ -467,3 +472,5 @@ do_max_length (struct _IO_codecvt *codecvt)
return MB_CUR_MAX;
#endif
}
+
+#endif /* defined(_GLIBCPP_USE_WCHAR_T) */
diff --git a/libstdc++-v3/libio/libio.h b/libstdc++-v3/libio/libio.h
index fb404b65283..6e5a3837551 100644
--- a/libstdc++-v3/libio/libio.h
+++ b/libstdc++-v3/libio/libio.h
@@ -254,7 +254,13 @@ struct _IO_wide_data
struct _IO_jump_t *_wide_vtable;
#endif
};
-#endif
+#else /* !(defined _LIBC || defined _GLIBCPP_USE_WCHAR_T) */
+/* Because _IO_no_init unconditionally takes a `_IO_wide_data*' as its
+ last parameter we must still define this type. We intentionally
+ leave it incomplete to prevent any use of this type when we are not
+ supporting wide characters. */
+struct _IO_wide_data;
+#endif /* !(defined _LIBC || defined _GLIBCPP_USE_WCHAR_T) */
struct _IO_FILE {
int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
diff --git a/libstdc++-v3/libio/wfiledoalloc.c b/libstdc++-v3/libio/wfiledoalloc.c
index 4e4ca67b2d3..9c051620414 100644
--- a/libstdc++-v3/libio/wfiledoalloc.c
+++ b/libstdc++-v3/libio/wfiledoalloc.c
@@ -46,6 +46,7 @@
# define _POSIX_SOURCE
#endif
#include "libioP.h"
+#ifdef _GLIBCPP_USE_WCHAR_T
#include <sys/types.h>
#include <sys/stat.h>
#ifdef __STDC__
@@ -103,3 +104,5 @@ _IO_wfile_doallocate (fp)
fp->_flags |= _IO_LINE_BUF;
return 1;
}
+
+#endif /* _GLIBCPP_USE_WCHAR_T */
diff --git a/libstdc++-v3/libio/wfileops.c b/libstdc++-v3/libio/wfileops.c
index 376014b2d7c..1dd524a3ffb 100644
--- a/libstdc++-v3/libio/wfileops.c
+++ b/libstdc++-v3/libio/wfileops.c
@@ -27,6 +27,7 @@
#include <assert.h>
#include <libioP.h>
+#ifdef _GLIBCPP_USE_WCHAR_T
#include <wchar.h>
#ifdef HAVE_GCONV_H
# include <gconv.h>
@@ -749,3 +750,5 @@ struct _IO_jump_t _IO_wfile_jumps =
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
+
+#endif /* _GLIBCPP_USE_WCHAR_T */
diff --git a/libstdc++-v3/libio/wgenops.c b/libstdc++-v3/libio/wgenops.c
index fa0aab36af0..74854524295 100644
--- a/libstdc++-v3/libio/wgenops.c
+++ b/libstdc++-v3/libio/wgenops.c
@@ -28,6 +28,7 @@
/* Generic or default I/O operations. */
#include "libioP.h"
+#ifdef _GLIBCPP_USE_WCHAR_T
#ifdef __STDC__
#include <stdlib.h>
#endif
@@ -751,3 +752,5 @@ _IO_unsave_wmarkers (fp)
if (_IO_have_backup (fp))
_IO_free_wbackup_area (fp);
}
+
+#endif /* _GLIBCPP_USE_WCHAR_T */
diff --git a/libstdc++-v3/src/codecvt.cc b/libstdc++-v3/src/codecvt.cc
index 839a9763167..688381f07c6 100644
--- a/libstdc++-v3/src/codecvt.cc
+++ b/libstdc++-v3/src/codecvt.cc
@@ -31,8 +31,10 @@
namespace std {
+#ifdef _GLIBCPP_USE_WCHAR_T
// Definitions for static const data members of __enc_traits.
const int __enc_traits::_S_max_size;
+#endif /* _GLIBCPP_USE_WCHAR_T */
// codecvt<char, char, mbstate_t> required specialization
locale::id codecvt<char, char, mbstate_t>::id;
diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc
index 3d91e51e36b..ee422c779c8 100644
--- a/libstdc++-v3/src/localename.cc
+++ b/libstdc++-v3/src/localename.cc
@@ -223,58 +223,84 @@ namespace std {
locale::_Impl::_M_construct_collate(const char* __name)
{
_M_facet_init(new collate_byname<char>(__name, 0));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new collate_byname<wchar_t>(__name, 0));
+#endif /* _GLIBCPP_USE_WCHAR_T */
}
void
locale::_Impl::_M_construct_ctype(const char* __name)
{
_M_facet_init(new ctype_byname<char>(__name, 0));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new ctype_byname<wchar_t>(__name, 0));
+#endif /* _GLIBCPP_USE_WCHAR_T */
_M_facet_init(new codecvt_byname<char, char, mbstate_t>(__name));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new codecvt_byname<wchar_t, char, mbstate_t>(__name));
+#endif /* _GLIBCPP_USE_WCHAR_T */
}
void
locale::_Impl::_M_construct_monetary(const char* __name)
{
_M_facet_init(new moneypunct_byname<char, false>(__name, 0));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new moneypunct_byname<wchar_t, false>(__name, 0));
+#endif /* _GLIBCPP_USE_WCHAR_T */
_M_facet_init(new moneypunct_byname<char, true >(__name, 0));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new moneypunct_byname<wchar_t, true >(__name, 0));
+#endif /* _GLIBCPP_USE_WCHAR_T */
_M_replace_facet(locale::_S_classic, &money_get<char>::id);
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_replace_facet(locale::_S_classic, &money_get<wchar_t>::id);
+#endif /* _GLIBCPP_USE_WCHAR_T */
_M_replace_facet(locale::_S_classic, &money_put<char>::id);
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_replace_facet(locale::_S_classic, &money_put<wchar_t>::id);
+#endif /* _GLIBCPP_USE_WCHAR_T */
}
void
locale::_Impl::_M_construct_numeric(const char* __name)
{
_M_facet_init(new numpunct_byname<char>(__name, 0));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new numpunct_byname<wchar_t>(__name, 0));
+#endif /* _GLIBCPP_USE_WCHAR_T */
_M_replace_facet(locale::_S_classic, &num_get<char>::id);
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_replace_facet(locale::_S_classic, &num_get<wchar_t>::id);
+#endif /* _GLIBCPP_USE_WCHAR_T */
_M_replace_facet(locale::_S_classic, &num_put<char>::id);
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_replace_facet(locale::_S_classic, &num_put<wchar_t>::id);
+#endif /* _GLIBCPP_USE_WCHAR_T */
}
void
locale::_Impl::_M_construct_time(const char* __name)
{
_M_facet_init(new time_get_byname<char>(__name, 0));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new time_get_byname<wchar_t>(__name, 0));
+#endif /* _GLIBCPP_USE_WCHAR_T */
_M_facet_init(new time_put_byname<char>(__name, 0));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new time_put_byname<wchar_t>(__name, 0));
+#endif /* _GLIBCPP_USE_WCHAR_T */
}
void
locale::_Impl::_M_construct_messages(const char* __name)
{
_M_facet_init(new messages_byname<char>(__name, 0));
+#ifdef _GLIBCPP_USE_WCHAR_T
_M_facet_init(new messages_byname<wchar_t>(__name, 0));
+#endif /* _GLIBCPP_USE_WCHAR_T */
}
}