This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
changes for approval, part one
- To: libstdc++ at sources dot redhat dot com
- Subject: changes for approval, part one
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: Sun, 15 Oct 2000 21:26:44 -0400
These are the general changes that I've made. A lot of the diffs are
formatting changes, e.g., wrapping seventy lines of script in if/then
means indenting them slightly, producing a 150-odd line diff.
Changes for Solaris all depend on these changes, so I'll come back
to those. All the stuff below has been tested to the best of my
one-and-a-half-platforms ability.
1) If no threads library is given, we shouldn't be trying to do any
threadsafe stuff, since we /can't/. Specifically, libio can't have
MTSAFE_IO turned on. So a new macro is added, _GLIBCPP_USE_THREADS,
and that wraps the definition of _IO_MTSAFE_IO in _G_config.h. If
any thread package is requested, _GLIBCPP_USE_THREADS is defined
to 1 and _IO_MTSAFE_IO stays on.
The "typedef _IO_lock_t __c_lock;" also needs to be wrapped.
[Background: __c_lock is the type of the fstream's _M_lock member,
which doesn't seem to be used in a non-MT-safe environment.
In any case, that class member /must/ be there because it gets
passed around in libio; all we can really change is its type.]
If threads are in use, then _IO_lock_t is a valid resolvable type.
Otherwise, it needs to be something else, something simple. Using
"void" or "void*" breaks. I picked int. So _GLIBCPP_USE_THREADS
conditionally compiles one typedef or another:
#ifdef _GLIBCPP_USE_THREADS
typedef _IO_lock_t __c_lock;
#else
typedef int __c_lock;
#endif
This seems slightly ugly to me, but since _IO_MTSAFE_IO is off, all
the libio code gets safely skipped. The parameter itself is assigned
to 0 when passed around, so 'int' seemed safest. (libio.h uses void,
which isn't even legal C, but I don't think that code branch has
ever been compiled; it's just a stub.)
2) The --{enable,disable}-c-mbchar from GCC's configure is added, on by
default. This lets us disable wide characters at the 'configure' level.
Doing so turns off _GLIBCPP_NEED_MBSTATE_T and _GLIBCPP_USE_WCHAR_T.
If multibyte characters are left on, then "need_wlibio" is set to yes as
per bkoz's "need to add checks to enable this" comment in acinclude.m4.
That way the related libio files will be built.
3) GLIBCPP_ENABLE_RELIBGCC is gone. (Now that libsupc++ is here.)
4) More comments and comment-cleanup in acinclude.m4 and configure.in.
Like I said, the number of lines added is small, but the number of lines
indented in acinclude.m4 makes for an ugly-looking diff. Does this seem
good to check in, or do you want to try to read the diff?
phil