From 08cee9a2a62a0b3a2823048ef773e9c6b9dfeaf3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 11 May 2001 10:50:06 +0000 Subject: [PATCH] Fixes for STLPort 4.1b6, and for gcc on platforms with [SVN r10089] --- changes.txt | 10 +++ configure.in | 85 ++------------------- include/boost/regex/detail/regex_config.hpp | 31 ++++---- include/boost/regex/src.cpp | 48 ++++++++++++ test/regress/regex_test.cpp | 18 +---- test/regress/regress.h | 9 ++- test/regress/wregex_test.cpp | 19 +---- 7 files changed, 87 insertions(+), 133 deletions(-) create mode 100644 include/boost/regex/src.cpp diff --git a/changes.txt b/changes.txt index bf989319..b04d18ac 100644 --- a/changes.txt +++ b/changes.txt @@ -1,3 +1,12 @@ +Version 311: +FIXED: Support for STLPort 4.1b6. +FIXED: Library calling convention for VC6 debug builds. +CHANGED: Reorganised and simplified config setup. + +Version 310: +ADDED: Support for static linking with VC6 + dynamic runtime. +CHANGED: Library directory structure. + Version 305: FIXED: VC6.sp5 fix. ADDED: Support for mixed static/dynamic linking with vc6. @@ -247,5 +256,6 @@ BUG: character sets don't function correctly when regbase::char_classes + diff --git a/configure.in b/configure.in index 5ad49e5d..9a4379de 100644 --- a/configure.in +++ b/configure.in @@ -540,85 +540,6 @@ AC_MSG_RESULT(no)]) fi -AC_ARG_ENABLE(int64, [--disable-int64 turns off support for 64-bit integer types]) -if test "$enable_int64" = "no"; then -AC_DEFINE(BOOST_RE_INT64_T_0) -else - -AC_MSG_CHECKING(for 64-bit integral type) - -if test "$ac_cv_sizeof_short" -eq 8; then -AC_DEFINE(BOOST_RE_INT64_T_1) -AC_MSG_RESULT(yes - short) -have_int64="true" -fi -if test "$ac_cv_sizeof_int" -eq 8 && test "$have_int64" != "true"; then -AC_DEFINE(BOOST_RE_INT64_T_2) -AC_MSG_RESULT(yes - int) -have_int64="true" -fi -if test "$ac_cv_sizeof_long" -eq 8 && test "$have_int64" != "true"; then -AC_DEFINE(BOOST_RE_INT64_T_3) -AC_MSG_RESULT(yes - long) -have_int64="true" -fi -if test "$have_int64" != "true"; then -AC_TRY_COMPILE( -[ -#include - -int64_t i = INT64_C(0x100000000); -], -[ -], -[AC_MSG_RESULT(yes - int64_t) -have_int64="true" -AC_DEFINE(BOOST_RE_INT64_T_4) -], -[]) -fi - -if test "$have_int64" != "true"; then - -AC_TRY_COMPILE( -[ -#include - -long long i = 0x100000000LL; -], -[ -], -[AC_MSG_RESULT(yes - long long) -have_int64="true" -AC_DEFINE(BOOST_RE_INT64_T_5) -], -[]) - -fi - -if test "$have_int64" != "true"; then - -AC_TRY_COMPILE( -[ -#include - -__int64 i = 0x100000000i64; -], -[ -], -[AC_MSG_RESULT(yes - __int64) -have_int64="true" -AC_DEFINE(BOOST_RE_INT64_T_6) -], -[]) -fi -if test "$have_int64" != "true"; then -AC_DEFINE(BOOST_RE_INT64_T,0) -AC_MSG_RESULT(no) -fi -fi - - AC_ARG_ENABLE(messages, [--disable-messages turns off support for POSIX message categories, when available.]) if test "$enable_messages" = "no" || test "$enable_ms_windows" != "no"; then AC_DEFINE(BOOST_RE_NO_CAT, []) @@ -827,6 +748,10 @@ std::locale l; std::map m; ], [ +if(std::has_facet >(l)) +{ + const std::ctype& ct = std::use_facet >(l); +} ], [AC_MSG_RESULT(yes) ac_have_locale='yes' @@ -1258,6 +1183,8 @@ rm -f jm_opt.out + + diff --git a/include/boost/regex/detail/regex_config.hpp b/include/boost/regex/detail/regex_config.hpp index 52e13247..a2286649 100644 --- a/include/boost/regex/detail/regex_config.hpp +++ b/include/boost/regex/detail/regex_config.hpp @@ -50,9 +50,6 @@ full list of macros and their usage. #include #include #include -#ifdef __CYGWIN__ -#include -#endif #include #else // @@ -163,7 +160,11 @@ full list of macros and their usage. // // only want "real" Visual C++ here: #if defined(BOOST_MSVC) && !defined(__WATCOMC__) && !defined(__BORLANDC__) && !defined(__GNUC__) && !defined(__MWERKS__) && !defined (__ICL) - #define BOOST_RE_CALL __fastcall + #ifdef _DEBUG + #define BOOST_RE_CALL __cdecl + #else + #define BOOST_RE_CALL __fastcall +#endif #define BOOST_RE_CCALL __stdcall #if BOOST_MSVC < 1100 @@ -362,33 +363,34 @@ full list of macros and their usage. #ifndef BOOST_RE_NO_ITERATOR_H #include - #if defined(__SGI_STL_INTERNAL_ITERATOR_H) || defined(__SGI_STL_ITERATOR_H) - + #if defined(__SGI_STL_INTERNAL_ITERATOR_H) || defined(_STLP_INTERNAL_ITERATOR_H) || defined(__SGI_STL_ITERATOR_H) || defined(__SGI_STL_PORT) + /* we are using SGI's STL some of these (std) may be guesswork: */ - # if (!defined (__SGI_STL_OWN_IOSTREAMS) && !defined(__GLIBCPP__) && !defined(__STL_USE_NEW_IOSTREAMS)) || defined (__STL_HAS_NO_NEW_IOSTREAMS) || defined (__STL_USE_NO_IOSTREAMS) || defined(__STL_NO_MBSTATE_T) + # if (!defined (__SGI_STL_OWN_IOSTREAMS) && !defined(_STLP_OWN_IOSTREAMS) && !defined(__GLIBCPP__) && !defined(__STL_USE_NEW_IOSTREAMS)) || defined (__STL_HAS_NO_NEW_IOSTREAMS) || defined(_STLP_HAS_NO_NEW_IOSTREAMS) || defined (__STL_USE_NO_IOSTREAMS) || defined(__STLP_USE_NO_IOSTREAMS) || defined(__STL_NO_MBSTATE_T) || defined(__STLP_NO_MBSTATE_T) // Old IO streams: #define BOOST_RE_NO_LOCALE_H #define BOOST_RE_OLD_IOSTREAM #else - #ifdef __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS + #include + #if defined( __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) || defined(_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS) #define BOOST_RE_USE_FACET(l, m) (*std::_Use_facet(l)) #endif #endif #ifdef __BASTRING__ #define BOOST_RE_NO_WCSTRING #endif - #if !defined(__STL_MEMBER_TEMPLATE_CLASSES) || !defined(__STL_MEMBER_TEMPLATES) + #if !(defined(__STL_MEMBER_TEMPLATE_CLASSES) || defined(__STLP_MEMBER_TEMPLATE_CLASSES)) || !(defined(__STL_MEMBER_TEMPLATES) || defined(__STLP_MEMBER_TEMPLATES)) #define BOOST_NO_MEMBER_TEMPLATES #endif #define BOOST_RE_NO_TYPEINFO - #ifdef __STL_NO_BOOL + #if defined(__STL_NO_BOOL) || defined(__STLP_NO_BOOL) #define BOOST_RE_NO_BOOL #endif - #ifdef __STL_LIMITED_DEFAULT_TEMPLATES + #if defined(__STL_LIMITED_DEFAULT_TEMPLATES) || defined(__STLP_LIMITED_DEFAULT_TEMPLATES) #define BOOST_RE_NO_TRICKY_DEFAULT_PARAM #define BOOST_RE_NO_STRING_DEF_ARGS #endif @@ -398,20 +400,17 @@ full list of macros and their usage. #define BOOST_RE_ALGO_INCLUDED - #if !defined( __STL_CLASS_PARTIAL_SPECIALIZATION) || !defined(__SGI_STL_PORT) + #if !(defined( __STL_CLASS_PARTIAL_SPECIALIZATION) || defined(__STLP_CLASS_PARTIAL_SPECIALIZATION)) || !defined(__SGI_STL_PORT) #define BOOST_NO_STD_DISTANCE #endif - #if defined(__STL_USE_STD_ALLOCATORS) || (defined(__SGI_STL_PORT ) && !defined(__STL_MEMBER_TEMPLATE_CLASSES) && !defined(__STL_MEMBER_TEMPLATES)) + #if defined(__STL_USE_STD_ALLOCATORS) || (defined(__SGI_STL_PORT ) && !defined(__STL_MEMBER_TEMPLATE_CLASSES) && !defined(__STLP_MEMBER_TEMPLATE_CLASSES) && !defined(__STL_MEMBER_TEMPLATES) && !defined(__STLP_MEMBER_TEMPLATES)) /* new style allocator's with nested template classes */ #else /* __STL_USE_STD_ALLOCATORS */ #define BOOST_NO_STD_ALLOCATOR #endif /* __STL_USE_STD_ALLOCATORS */ #define BOOST_RE_STL_DONE - #ifndef __SGI_STL_PORT - //#define BOOST_RE_NO_NOT_EQUAL - #endif #elif defined(_RWSTD_VER) || defined(__STD_ITERATOR__) diff --git a/include/boost/regex/src.cpp b/include/boost/regex/src.cpp new file mode 100644 index 00000000..63f3ca02 --- /dev/null +++ b/include/boost/regex/src.cpp @@ -0,0 +1,48 @@ +/* + * + * Copyright (c) 1998-2000 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE src.cpp + * VERSION 3.11 + * DESCRIPTION: Includes all the regex source files, include this + * file only if you need to build the regex library + * as a single file. Before including this file you + * must define BOOST_RE_NO_LIB, or include this file + * before any other regex header. + */ + +#if !defined(BOOST_RE_NO_LIB) && defined(BOOST_REGEX_CONFIG_HPP) +#error too late you have already included a regex header - try defining BOOST_RE_NO_LIB when you build +#endif + +// +// include library source files: +// +#ifdef BOOST_RE_LOCALE_W32 +#include "libs/regex/src/w32_regex_traits.cpp" +#elif defined(BOOST_RE_LOCALE_C) +#include "libs/regex/src/c_regex_traits.cpp" +#else +#include "libs/regex/src/cpp_regex_traits.cpp" +#endif +#include "libs/regex/src/c_regex_traits_common.cpp" +#include "libs/regex/src/cregex.cpp" +#include "libs/regex/src/fileiter.cpp" +#include "libs/regex/src/posix_api.cpp" +#include "libs/regex/src/wide_posix_api.cpp" +#include "libs/regex/src/regex.cpp" +#include "libs/regex/src/regex_debug.cpp" +#include "libs/regex/src/regex_synch.cpp" diff --git a/test/regress/regex_test.cpp b/test/regress/regex_test.cpp index b40eac66..4423a809 100644 --- a/test/regress/regex_test.cpp +++ b/test/regress/regex_test.cpp @@ -27,6 +27,7 @@ #define BOOST_RE_NO_LIB #include +#include // // instantiate templates used: @@ -179,22 +180,5 @@ template test_string_type regex_merge(const test_string_type&, #include "parse.cpp" #include "regress.cpp" -// -// include library source files: -// -#ifdef BOOST_RE_LOCALE_W32 -#include "libs/regex/src/w32_regex_traits.cpp" -#elif defined(BOOST_RE_LOCALE_C) -#include "libs/regex/src/c_regex_traits.cpp" -#else -#include "libs/regex/src/cpp_regex_traits.cpp" -#endif -#include "libs/regex/src/c_regex_traits_common.cpp" -#include "libs/regex/src/cregex.cpp" -#include "libs/regex/src/fileiter.cpp" -#include "libs/regex/src/posix_api.cpp" -#include "libs/regex/src/regex.cpp" -#include "libs/regex/src/regex_debug.cpp" -#include "libs/regex/src/regex_synch.cpp" diff --git a/test/regress/regress.h b/test/regress/regress.h index de3ad69c..a641348e 100644 --- a/test/regress/regress.h +++ b/test/regress/regress.h @@ -306,11 +306,14 @@ struct debug_iterator } }; -#if defined(__SGI_STL_PORT) +#if defined(__SGI_STL_PORT) namespace std{ template -inline random_access_iterator_tag __STL_CALL -__ITERATOR_CATEGORY(const debug_iterator&) { +#if __SGI_STL_PORT <= 0x400 +inline random_access_iterator_tag __STL_CALL __ITERATOR_CATEGORY(const debug_iterator&) { +#else +inline random_access_iterator_tag __iterator_category(const debug_iterator&) { +#endif return random_access_iterator_tag(); } } diff --git a/test/regress/wregex_test.cpp b/test/regress/wregex_test.cpp index fdfea4ee..100a4a43 100644 --- a/test/regress/wregex_test.cpp +++ b/test/regress/wregex_test.cpp @@ -39,6 +39,7 @@ #endif #include +#include #ifdef BOOST_RE_NO_WCSTRING #error The regex library is not configured for wide character support @@ -190,23 +191,5 @@ template test_string_type regex_merge(const test_string_type&, #include "parse.cpp" #include "regress.cpp" -// -// include library source files: -// -#ifdef BOOST_RE_LOCALE_W32 -#include "libs/regex/src/w32_regex_traits.cpp" -#elif defined(BOOST_RE_LOCALE_C) -#include "libs/regex/src/c_regex_traits.cpp" -#else -#include "libs/regex/src/cpp_regex_traits.cpp" -#endif -#include "libs/regex/src/c_regex_traits_common.cpp" -#include "libs/regex/src/cregex.cpp" -#include "libs/regex/src/fileiter.cpp" -#include "libs/regex/src/regex.cpp" -#include "libs/regex/src/regex_debug.cpp" -#include "libs/regex/src/regex_synch.cpp" -#include "libs/regex/src/wide_posix_api.cpp" -