From 30ff6342d44939fd18830d230adecb1388a73b35 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Thu, 1 Jun 2000 00:52:26 +0000 Subject: [PATCH] [multiple changes] 2000-05-31 Benjamin Kosnik * acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): Add strtoull checks... 2000-05-31 Steven King * shadow/time.h: fix typo * shadow/wchar.h: ifdef __USE_GNU for wcsdup * shadow/bits/std_cwchar.h: ditto * shadow/bits/std_cstdlib.h: add overloads of abs and div for long and long long. From-SVN: r34321 --- libstdc++-v3/ChangeLog | 12 ++++++ libstdc++-v3/acinclude.m4 | 13 ++++-- libstdc++-v3/libio/Makefile.in | 10 ++--- libstdc++-v3/shadow/bits/std_cstdlib.h | 57 ++++++++++++++++++-------- libstdc++-v3/shadow/bits/std_cwchar.h | 2 + libstdc++-v3/shadow/time.h | 2 +- libstdc++-v3/shadow/wchar.h | 2 + libstdc++-v3/src/Makefile.in | 19 ++++----- 8 files changed, 78 insertions(+), 39 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8ffdb3d9916..6a775a22ff9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2000-05-31 Benjamin Kosnik + + * acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): Add strtoull checks... + +2000-05-31 Steven King + + * shadow/time.h: fix typo + * shadow/wchar.h: ifdef __USE_GNU for wcsdup + * shadow/bits/std_cwchar.h: ditto + * shadow/bits/std_cstdlib.h: add overloads of abs and div for long + and long long. + 2000-05-26 Phil Edwards * acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): If strtoll isn't diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 0c33149f36e..9030b7f0cb8 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -948,8 +948,7 @@ dnl dnl GLIBCPP_ENABLE_LONG_LONG AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl - # must do check_func outside the local msg_checking/msg_result - AC_CHECK_FUNC(strtoll,,ac_ll=no) + AC_MSG_CHECKING([for enabled long long]) AC_ARG_ENABLE(long-long, changequote(<<, >>)dnl @@ -961,7 +960,15 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;; esac], enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl - if test x"$ac_ll" = xno; then enable_long_long=no; fi; unset ac_ll + + # Check for the existance of functions used if long long is enabled. + AC_CHECK_FUNC(strtoll,,ac_strtoll=no) + AC_CHECK_FUNC(strtoull,,ac_strtoull=no) + + if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then + enable_long_long=no; + fi; unset ac_ll + AC_MSG_RESULT($enable_long_long) dnl Option parsed, now set things appropriately case "$enable_long_long" in diff --git a/libstdc++-v3/libio/Makefile.in b/libstdc++-v3/libio/Makefile.in index 1f524f97584..c82b27cbc76 100644 --- a/libstdc++-v3/libio/Makefile.in +++ b/libstdc++-v3/libio/Makefile.in @@ -116,19 +116,17 @@ includes = libio_headers = \ libio.h libioP.h iolibio.h -@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = \ -@GLIBCPP_NEED_LIBIO_TRUE@\ +@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = @GLIBCPP_NEED_LIBIO_TRUE@\ @GLIBCPP_NEED_LIBIO_TRUE@ filedoalloc.c genops.c fileops.c stdfiles.c cleanup.c -@GLIBCPP_NEED_LIBIO_FALSE@LIBIO_SRCS = \ +@GLIBCPP_NEED_LIBIO_FALSE@LIBIO_SRCS = EXTRA_DIST = iostreamP.h libio_la_LIBADD = $(LIBIO_SRCS) libio_la_DEPENDENCIES = $(libio_la_LIBADD) libio_la_SOURCES = $(LIBIO_SRCS) -@GLIBCPP_NEED_LIBIO_CONFIG_H_TRUE@LIBIO_CONFIG_H = \ -@GLIBCPP_NEED_LIBIO_CONFIG_H_TRUE@_G_config.h -@GLIBCPP_NEED_LIBIO_CONFIG_H_FALSE@LIBIO_CONFIG_H = \ +@GLIBCPP_NEED_LIBIO_CONFIG_H_TRUE@LIBIO_CONFIG_H = @GLIBCPP_NEED_LIBIO_CONFIG_H_TRUE@_G_config.h +@GLIBCPP_NEED_LIBIO_CONFIG_H_FALSE@LIBIO_CONFIG_H = mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = diff --git a/libstdc++-v3/shadow/bits/std_cstdlib.h b/libstdc++-v3/shadow/bits/std_cstdlib.h index 26c9a870638..438d4456125 100644 --- a/libstdc++-v3/shadow/bits/std_cstdlib.h +++ b/libstdc++-v3/shadow/bits/std_cstdlib.h @@ -1,6 +1,6 @@ // -*- C++ -*- header wrapper -// Copyright (C) 1997-1999 Free Software Foundation, Inc. +// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -40,25 +40,25 @@ # include /* pick up NULL, size_t */ - namespace _C_legacy { - extern "C" { +namespace _C_legacy { + extern "C" { # define _IN_C_LEGACY_ # pragma system_header # include_next typedef int (*_C_cmp_fun_ptr)(const void*, const void*); // C fn ptr } - const int _CPP_EXIT_SUCCESS_capture = int(EXIT_SUCCESS); - const int _CPP_EXIT_FAILURE_capture = int(EXIT_FAILURE); - const int _CPP_RAND_MAX_capture = int(RAND_MAX); - inline int _CPP_MB_CUR_MAX_capture() { return int(MB_CUR_MAX); } - // typedef size_t _CPP_size_t_capture; - // typedef wchar_t _CPP_wchar_t_capture; - typedef div_t _CPP_div_t_capture; - typedef ldiv_t _CPP_ldiv_t_capture; + const int _CPP_EXIT_SUCCESS_capture = int(EXIT_SUCCESS); + const int _CPP_EXIT_FAILURE_capture = int(EXIT_FAILURE); + const int _CPP_RAND_MAX_capture = int(RAND_MAX); + inline int _CPP_MB_CUR_MAX_capture() { return int(MB_CUR_MAX); } + // typedef size_t _CPP_size_t_capture; + // typedef wchar_t _CPP_wchar_t_capture; + typedef div_t _CPP_div_t_capture; + typedef ldiv_t _CPP_ldiv_t_capture; - namespace _C_shadow { - } - } // close namespace ::_C_legacy:: + namespace _C_shadow { + } +} // namespace _C_legacy:: # undef size_t # undef wchar_t @@ -100,6 +100,10 @@ # undef div # undef labs # undef ldiv +#ifdef _GLIBCPP_USE_LONG_LONG +# undef llabs +# undef lldiv +#endif # undef mblen # undef mbtowc # undef wctomb @@ -185,11 +189,25 @@ inline int abs(int __x) { return __x >= 0 ? __x : -__x; } inline div_t div(int __n, int __d) - { _div_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + { div_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } inline long labs(long __x) { return __x >= 0 ? __x : -__x; } - inline ldiv_t ldiv(long __num, long __den) - { _ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + inline long abs(long __x) + { return __x >= 0 ? __x : -__x; } + inline ldiv_t ldiv(long __n, long __d) + { ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + inline ldiv_t div(long __n, long __d) + { ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } +#ifdef _GLIBCPP_USE_LONG_LONG + inline long long llabs(long long __x) + { return __x >= 0 ? __x : -__x; } + inline long long abs(long long __x) + { return __x >= 0 ? __x : -__x; } + inline lldiv_t lldiv(long long __n, long long __d) + { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + inline lldiv_t div(long long __n, long long __d) + { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } +#endif using ::_C_legacy::mblen; using ::_C_legacy::mbtowc;; @@ -213,6 +231,10 @@ using ::std::div; using ::std::labs; using ::std::ldiv; +#ifdef _GLIBCPP_USE_LONG_LONG + using ::std::llabs; + using ::std::lldiv; +#endif } } @@ -220,3 +242,4 @@ #endif + diff --git a/libstdc++-v3/shadow/bits/std_cwchar.h b/libstdc++-v3/shadow/bits/std_cwchar.h index bd5c74c9089..d4700ecf003 100644 --- a/libstdc++-v3/shadow/bits/std_cwchar.h +++ b/libstdc++-v3/shadow/bits/std_cwchar.h @@ -213,7 +213,9 @@ using ::_C_legacy::wcstok; using ::_C_legacy::wcslen; #ifndef __sun +#ifdef __USE_GNU using ::_C_legacy::wcsdup; +#endif using ::_C_legacy::wcsstr; using ::_C_legacy::wmemchr; using ::_C_legacy::wmemcmp; diff --git a/libstdc++-v3/shadow/time.h b/libstdc++-v3/shadow/time.h index 2ace7c93ed9..db241651d9c 100644 --- a/libstdc++-v3/shadow/time.h +++ b/libstdc++-v3/shadow/time.h @@ -33,7 +33,7 @@ // turn off glibc-2.0 weirdness. Other systems define similar foolishness #undef __need_time_t #undef __need_clock_t -#undef __need_timespec)) +#undef __need_timespec # undef _SHADOW_NAME # define _SHADOW_NAME diff --git a/libstdc++-v3/shadow/wchar.h b/libstdc++-v3/shadow/wchar.h index 7686cdbe11e..7dff1c52f2c 100644 --- a/libstdc++-v3/shadow/wchar.h +++ b/libstdc++-v3/shadow/wchar.h @@ -66,7 +66,9 @@ using ::std::wcscmp; using ::std::wcscoll; using ::std::wcsxfrm; +# ifdef __USE_GNU using ::std::wcsdup; +# endif using ::std::wcschr; using ::std::wcscspn; using ::std::wcspbrk; diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index 929a153094d..c4fa9ede4a4 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -105,12 +105,9 @@ libinst_wstring_la = @libinst_wstring_la@ AUTOMAKE_OPTIONS = 1.3 gnits MAINT_CHARSET = latin1 -@USE_LIBDIR_TRUE@toolexeclibdir = \ -@USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR) -@USE_LIBDIR_FALSE@toolexeclibdir = \ -@USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR) -@USE_LIBDIR_FALSE@toolexecdir = \ -@USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias) +@USE_LIBDIR_TRUE@toolexeclibdir = @USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR) +@USE_LIBDIR_FALSE@toolexeclibdir = @USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR) +@USE_LIBDIR_FALSE@toolexecdir = @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias) toolexeclib_LTLIBRARIES = libstdc++.la EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la @@ -256,10 +253,9 @@ std_headers = \ map memory new numeric ostream queue set sstream stack stdexcept \ streambuf string strstream typeinfo utility valarray vector -@GLIBCPP_NEED_LIBIO_TRUE@libio_headers = \ -@GLIBCPP_NEED_LIBIO_TRUE@\ +@GLIBCPP_NEED_LIBIO_TRUE@libio_headers = @GLIBCPP_NEED_LIBIO_TRUE@\ @GLIBCPP_NEED_LIBIO_TRUE@ $(top_builddir)/libio/_G_config.h $(top_srcdir)/libio/libio.h -@GLIBCPP_NEED_LIBIO_FALSE@libio_headers = \ +@GLIBCPP_NEED_LIBIO_FALSE@libio_headers = generated_headers = \ $(top_builddir)/bits/std_limits.h $(top_builddir)/bits/c++config.h \ @@ -338,9 +334,8 @@ libstdc___la_LIBADD = \ libstdc___la_LDFLAGS = -version-info 3:0:0 -lm libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD) -@GLIBCPP_USE_CSHADOW_TRUE@CSHADOW_H = \ -@GLIBCPP_USE_CSHADOW_TRUE@$(top_builddir)/stamp-cshadow -@GLIBCPP_USE_CSHADOW_FALSE@CSHADOW_H = \ +@GLIBCPP_USE_CSHADOW_TRUE@CSHADOW_H = @GLIBCPP_USE_CSHADOW_TRUE@$(top_builddir)/stamp-cshadow +@GLIBCPP_USE_CSHADOW_FALSE@CSHADOW_H = # We cannot use the default rules to install headers since we cannot # statically decide which headers to install. So we have our own special