Repeats now work, Jamfiles and portability issues also addressed.

[SVN r22512]
This commit is contained in:
John Maddock committed 2004-03-17 13:18:27 +00:00
1 parent 4d2d3a1450
commit 23d7352b19
19 files changed
+565 -129

No files matched your search

+7
View File
@@ -162,6 +162,10 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA* expression, const char* buf, regsize_t n, regmatch_t* array, int eflags)
{
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4267)
#endif
bool result = false;
match_flag_type flags = match_default | expression->eflags;
const char* end;
@@ -217,6 +221,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA* expression, cons
return 0;
}
return REG_NOMATCH;
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
}
BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeA(regex_tA* expression)
+2 -2
View File
@@ -95,7 +95,7 @@ const char* get_default_error_string(regex_constants::error_type n)
"Invalid back reference", /* REG_ESUBREG */
"Unmatched [ or [^", /* REG_EBRACK */
"Unmatched ( or \\(", /* REG_EPAREN */
"Unmatched \\{", /* REG_EBRACE */
"Unmatched { or \\{", /* REG_EBRACE */
"Invalid content of \\{\\}", /* REG_BADBR */
"Invalid range end", /* REG_ERANGE */
"Memory exhausted", /* REG_ESPACE */
@@ -112,7 +112,7 @@ const char* get_default_error_string(regex_constants::error_type n)
"",
};
return (n <= REG_E_UNKNOWN) ? s_default_error_messages[REG_E_UNKNOWN] : s_default_error_messages[n];
return (n > REG_E_UNKNOWN) ? s_default_error_messages[REG_E_UNKNOWN] : s_default_error_messages[n];
}
bool is_combining_implementation(boost::uint_least16_t c)
+14 -1
View File
@@ -23,7 +23,10 @@
#include <boost/regex/static_mutex.hpp>
#if defined(BOOST_HAS_WINTHREADS)
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <boost/static_assert.hpp>
#endif
@@ -64,6 +67,8 @@ void scoped_static_mutex_lock::unlock()
#elif defined(BOOST_HAS_WINTHREADS)
BOOST_STATIC_ASSERT(sizeof(LONG) == sizeof(boost::int32_t));
scoped_static_mutex_lock::scoped_static_mutex_lock(static_mutex& m, bool lk)
: m_mutex(m), m_have_lock(false)
{
@@ -81,7 +86,11 @@ void scoped_static_mutex_lock::lock()
{
if(0 == m_have_lock)
{
while(0 != InterlockedCompareExchange((LONG*)&(m_mutex.m_mutex), 1, 0))
#if defined(BOOST_MSVC) && (BOOST_MSVC <=1200)
while(0 != InterlockedCompareExchange(reinterpret_cast<void**>((boost::uint_least16_t*)&(m_mutex.m_mutex)), (void*)1, 0))
#else
while(0 != InterlockedCompareExchange(reinterpret_cast<volatile LONG*>(&(m_mutex.m_mutex)), 1, 0))
#endif
{
Sleep(0);
}
@@ -93,7 +102,11 @@ void scoped_static_mutex_lock::unlock()
{
if(m_have_lock)
{
#if defined(BOOST_MSVC) && (BOOST_MSVC <=1200)
InterlockedExchange((LONG*)&(m_mutex.m_mutex), 0);
#else
InterlockedExchange(reinterpret_cast<volatile LONG*>(&(m_mutex.m_mutex)), 0);
#endif
m_have_lock = false;
}
}
+7
View File
@@ -170,6 +170,10 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW* expression, const wchar_t* buf, regsize_t n, regmatch_t* array, int eflags)
{
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4267)
#endif
bool result = false;
match_flag_type flags = match_default | expression->eflags;
const wchar_t* end;
@@ -224,6 +228,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW* expression, cons
return 0;
}
return REG_NOMATCH;
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
}
BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW* expression)