mirror of
https://github.com/boostorg/regex.git
synced 2025-07-16 22:02:08 +02:00
Made this header C compatible.
[SVN r28292]
This commit is contained in:
@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||||
#define BOOST_REGEX_CONFIG_HPP
|
#define BOOST_REGEX_CONFIG_HPP
|
||||||
//
|
/*
|
||||||
// Borland C++ Fix/error check
|
* Borland C++ Fix/error check
|
||||||
// this has to go *before* we include any std lib headers:
|
* this has to go *before* we include any std lib headers:
|
||||||
//
|
*/
|
||||||
#if defined(__BORLANDC__)
|
#if defined(__BORLANDC__)
|
||||||
# include <boost/regex/config/borland.hpp>
|
# include <boost/regex/config/borland.hpp>
|
||||||
#endif
|
#endif
|
||||||
@ -43,11 +43,11 @@
|
|||||||
# include <boost/config.hpp>
|
# include <boost/config.hpp>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
//
|
/*
|
||||||
// C build,
|
* C build,
|
||||||
// don't include <boost/config.hpp> because that may
|
* don't include <boost/config.hpp> because that may
|
||||||
// do C++ specific things in future...
|
* do C++ specific things in future...
|
||||||
//
|
*/
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
# include <stddef.h>
|
# include <stddef.h>
|
||||||
# ifdef _MSC_VER
|
# ifdef _MSC_VER
|
||||||
@ -64,34 +64,34 @@
|
|||||||
/* Obsolete macro, use BOOST_VERSION instead: */
|
/* Obsolete macro, use BOOST_VERSION instead: */
|
||||||
#define BOOST_RE_VERSION 320
|
#define BOOST_RE_VERSION 320
|
||||||
|
|
||||||
// fix:
|
/* fix: */
|
||||||
#if defined(_UNICODE) && !defined(UNICODE)
|
#if defined(_UNICODE) && !defined(UNICODE)
|
||||||
#define UNICODE
|
#define UNICODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
/*
|
||||||
// Fix for gcc prior to 3.4: std::ctype<wchar_t> doesn't allow
|
* Fix for gcc prior to 3.4: std::ctype<wchar_t> doesn't allow
|
||||||
// masks to be combined, for example:
|
* masks to be combined, for example:
|
||||||
// std::use_facet<std::ctype<wchar_t> >.is(std::ctype_base::lower|std::ctype_base::upper, L'a');
|
* std::use_facet<std::ctype<wchar_t> >.is(std::ctype_base::lower|std::ctype_base::upper, L'a');
|
||||||
// returns *false*.
|
* returns *false*.
|
||||||
//
|
*/
|
||||||
#ifdef __GLIBCPP__
|
#ifdef __GLIBCPP__
|
||||||
# define BOOST_REGEX_BUGGY_CTYPE_FACET
|
# define BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
/*
|
||||||
// If there isn't good enough wide character support then there will
|
* If there isn't good enough wide character support then there will
|
||||||
// be no wide character regular expressions:
|
* be no wide character regular expressions:
|
||||||
//
|
*/
|
||||||
#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING))
|
#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING))
|
||||||
# if !defined(BOOST_NO_WREGEX)
|
# if !defined(BOOST_NO_WREGEX)
|
||||||
# define BOOST_NO_WREGEX
|
# define BOOST_NO_WREGEX
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# if defined(__sgi) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
# if defined(__sgi) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
||||||
// STLPort on IRIX is misconfigured: <cwctype> does not compile
|
/* STLPort on IRIX is misconfigured: <cwctype> does not compile
|
||||||
// as a temporary fix include <wctype.h> instead and prevent inclusion
|
* as a temporary fix include <wctype.h> instead and prevent inclusion
|
||||||
// of STLPort version of <cwctype>
|
* of STLPort version of <cwctype> */
|
||||||
# include <wctype.h>
|
# include <wctype.h>
|
||||||
# define __STLPORT_CWCTYPE
|
# define __STLPORT_CWCTYPE
|
||||||
# define _STLP_CWCTYPE
|
# define _STLP_CWCTYPE
|
||||||
@ -103,28 +103,28 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
/*
|
||||||
// If Win32 support has been disabled for boost in general, then
|
* If Win32 support has been disabled for boost in general, then
|
||||||
// it is for regex in particular:
|
* it is for regex in particular:
|
||||||
//
|
*/
|
||||||
#if defined(BOOST_DISABLE_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
#if defined(BOOST_DISABLE_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||||
# define BOOST_REGEX_NO_W32
|
# define BOOST_REGEX_NO_W32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// disable our own file-iterators and mapfiles if we can't
|
/* disable our own file-iterators and mapfiles if we can't
|
||||||
// support them:
|
* support them: */
|
||||||
#if !defined(BOOST_HAS_DIRENT_H) && !(defined(_WIN32) && !defined(BOOST_REGEX_NO_W32))
|
#if !defined(BOOST_HAS_DIRENT_H) && !(defined(_WIN32) && !defined(BOOST_REGEX_NO_W32))
|
||||||
# define BOOST_REGEX_NO_FILEITER
|
# define BOOST_REGEX_NO_FILEITER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// backwards compatibitity:
|
/* backwards compatibitity: */
|
||||||
#if defined(BOOST_RE_NO_LIB)
|
#if defined(BOOST_RE_NO_LIB)
|
||||||
# define BOOST_REGEX_NO_LIB
|
# define BOOST_REGEX_NO_LIB
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && (defined(_WIN32) || defined(__CYGWIN__))
|
#if defined(__GNUC__) && (defined(_WIN32) || defined(__CYGWIN__))
|
||||||
// gcc on win32 has problems if you include <windows.h>
|
/* gcc on win32 has problems if you include <windows.h>
|
||||||
// (sporadically generates bad code).
|
(sporadically generates bad code). */
|
||||||
# define BOOST_REGEX_NO_W32
|
# define BOOST_REGEX_NO_W32
|
||||||
#endif
|
#endif
|
||||||
#if defined(__COMO__) && !defined(BOOST_REGEX_NO_W32) && !defined(_MSC_EXTENSIONS)
|
#if defined(__COMO__) && !defined(BOOST_REGEX_NO_W32) && !defined(_MSC_EXTENSIONS)
|
||||||
@ -137,13 +137,13 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
//
|
/*
|
||||||
// define BOOST_REGEX_HAS_OTHER_WCHAR_T when wchar_t is a native type, but the users
|
* define BOOST_REGEX_HAS_OTHER_WCHAR_T when wchar_t is a native type, but the users
|
||||||
// code may be built with wchar_t as unsigned short: basically when we're building
|
* code may be built with wchar_t as unsigned short: basically when we're building
|
||||||
// with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions
|
* with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions
|
||||||
// of the non-inline functions in the library, so that users can still link to the lib,
|
* of the non-inline functions in the library, so that users can still link to the lib,
|
||||||
// irrespective of whether their own code is built with /Zc:wchar_t.
|
* irrespective of whether their own code is built with /Zc:wchar_t.
|
||||||
//
|
*/
|
||||||
#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS)
|
#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS)
|
||||||
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
|
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
|
||||||
# ifdef BOOST_MSVC
|
# ifdef BOOST_MSVC
|
||||||
@ -223,7 +223,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
// backwards compatibility:
|
/* backwards compatibility: */
|
||||||
#ifdef BOOST_RE_LOCALE_C
|
#ifdef BOOST_RE_LOCALE_C
|
||||||
# define BOOST_REGEX_USE_C_LOCALE
|
# define BOOST_REGEX_USE_C_LOCALE
|
||||||
#endif
|
#endif
|
||||||
@ -232,15 +232,15 @@
|
|||||||
# define BOOST_REGEX_USE_CPP_LOCALE
|
# define BOOST_REGEX_USE_CPP_LOCALE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Win32 defaults to native Win32 locale:
|
/* Win32 defaults to native Win32 locale: */
|
||||||
#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
|
#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
|
||||||
# define BOOST_REGEX_USE_WIN32_LOCALE
|
# define BOOST_REGEX_USE_WIN32_LOCALE
|
||||||
#endif
|
#endif
|
||||||
// otherwise use C++ locale if supported:
|
/* otherwise use C++ locale if supported: */
|
||||||
#if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_NO_STD_LOCALE)
|
#if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_NO_STD_LOCALE)
|
||||||
# define BOOST_REGEX_USE_CPP_LOCALE
|
# define BOOST_REGEX_USE_CPP_LOCALE
|
||||||
#endif
|
#endif
|
||||||
// otherwise use C+ locale:
|
/* otherwise use C+ locale: */
|
||||||
#if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE)
|
#if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE)
|
||||||
# define BOOST_REGEX_USE_C_LOCALE
|
# define BOOST_REGEX_USE_C_LOCALE
|
||||||
#endif
|
#endif
|
||||||
@ -257,10 +257,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef BOOST_NO_EXCEPTIONS
|
#ifdef BOOST_NO_EXCEPTIONS
|
||||||
//
|
/*
|
||||||
// If there are no exceptions then we must report critical-errors
|
* If there are no exceptions then we must report critical-errors
|
||||||
// the only way we know how; by terminating.
|
* the only way we know how; by terminating.
|
||||||
//
|
*/
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
@ -274,10 +274,10 @@ if(0 == (x))\
|
|||||||
boost::throw_exception(e);\
|
boost::throw_exception(e);\
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
//
|
/*
|
||||||
// With exceptions then error handling is taken care of and
|
* With exceptions then error handling is taken care of and
|
||||||
// there is no need for these checks:
|
* there is no need for these checks:
|
||||||
//
|
*/
|
||||||
# define BOOST_REGEX_NOEH_ASSERT(x)
|
# define BOOST_REGEX_NOEH_ASSERT(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ namespace boost{ namespace re_detail{
|
|||||||
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block();
|
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block();
|
||||||
BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*);
|
BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*);
|
||||||
|
|
||||||
}} // namespaces
|
}} /* namespaces */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
Reference in New Issue
Block a user