mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
rework regexp processor magic ; make tr1 work with autotools
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34730 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
69036ced37
commit
af928c503d
@ -289,6 +289,15 @@ char * strerror(int n);
|
||||
#define BOOST_NO_WREGEX 1
|
||||
#define BOOST_NO_WSTRING 1
|
||||
|
||||
#ifndef LYX_USE_TR1
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
# define LYX_USE_TR1
|
||||
# endif
|
||||
# if __GNUC__ == 4 && __GNUC_MINOR__ >= 4
|
||||
# define LYX_USE_TR1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
# define NOMINMAX
|
||||
# define BOOST_POSIX 1
|
||||
|
@ -35,7 +35,6 @@ liblyxsupport_a_SOURCES = \
|
||||
FileMonitor.cpp \
|
||||
RandomAccessList.h \
|
||||
bind.h \
|
||||
checktr1.h \
|
||||
convert.cpp \
|
||||
convert.h \
|
||||
copied_ptr.h \
|
||||
|
@ -12,9 +12,6 @@
|
||||
#ifndef LYX_BIND_H
|
||||
#define LYX_BIND_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#ifdef LYX_USE_TR1
|
||||
|
||||
#include <functional>
|
||||
@ -33,7 +30,7 @@ namespace lyx
|
||||
|
||||
#else
|
||||
|
||||
#include "boost/bind.hpp"
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
namespace lyx
|
||||
{
|
||||
|
@ -12,53 +12,39 @@
|
||||
#ifndef LYX_REGEXP_H
|
||||
#define LYX_REGEXP_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#define LYX_REGEX_TO_LYX(X) \
|
||||
using X::regex; \
|
||||
using X::smatch; \
|
||||
using X::regex_replace; \
|
||||
using X::basic_regex; \
|
||||
using X::regex_error; \
|
||||
using X::regex_search; \
|
||||
using X::sregex_iterator; \
|
||||
using X::match_results; \
|
||||
\
|
||||
namespace regex_constants \
|
||||
{ \
|
||||
using namespace X::regex_constants; \
|
||||
using X::regex_constants::match_flag_type; \
|
||||
} \
|
||||
|
||||
|
||||
|
||||
#if defined(LYX_USE_TR1) && defined(LYX_USE_TR1_REGEX)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <regex>
|
||||
#define match_partial _Match_partial
|
||||
#else
|
||||
#include <tr1/regex>
|
||||
// TODO no match_partial in gcc, how to replace?
|
||||
#define match_partial match_default
|
||||
#endif
|
||||
|
||||
namespace lyx
|
||||
{
|
||||
LYX_REGEX_TO_LYX(std::tr1);
|
||||
}
|
||||
|
||||
# ifdef _MSC_VER
|
||||
# include <regex>
|
||||
# define match_partial _Match_partial
|
||||
# else
|
||||
# include <tr1/regex>
|
||||
// TODO no match_partial in gcc, how to replace?
|
||||
# define match_partial match_default
|
||||
# endif
|
||||
# define LR_NS std::tr1
|
||||
#else
|
||||
# include <boost/regex.hpp>
|
||||
# define LR_NS boost
|
||||
#endif
|
||||
|
||||
#include "boost/regex.hpp"
|
||||
namespace lyx {
|
||||
using LR_NS::regex;
|
||||
using LR_NS::smatch;
|
||||
using LR_NS::regex_replace;
|
||||
using LR_NS::basic_regex;
|
||||
using LR_NS::regex_error;
|
||||
using LR_NS::regex_search;
|
||||
using LR_NS::sregex_iterator;
|
||||
using LR_NS::match_results;
|
||||
|
||||
namespace lyx
|
||||
namespace regex_constants
|
||||
{
|
||||
LYX_REGEX_TO_LYX(boost);
|
||||
using namespace LR_NS::regex_constants;
|
||||
using LR_NS::regex_constants::match_flag_type;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef LR_NS
|
||||
|
||||
#endif
|
||||
|
@ -12,9 +12,6 @@
|
||||
#ifndef LYX_SHARED_PTR_H
|
||||
#define LYX_SHARED_PTR_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#ifdef LYX_USE_TR1
|
||||
|
||||
#include <memory>
|
||||
|
Loading…
Reference in New Issue
Block a user