also use TR1 code for bind and shared_ptr when compiling with GCC >= 4.4

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34600 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2010-06-05 11:06:13 +00:00
parent f403c0a601
commit 807fc1443a
4 changed files with 41 additions and 3 deletions

View File

@ -37,7 +37,7 @@
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#include <iterator> #include <iterator>
#include <memory>
using namespace std; using namespace std;
using namespace lyx::support; using namespace lyx::support;

View File

@ -12,10 +12,17 @@
#ifndef LYX_BIND_H #ifndef LYX_BIND_H
#define LYX_BIND_H #define LYX_BIND_H
#if defined(_MSC_VER) && (_MSC_VER >= 1600) #include "checktr1.h"
#ifdef LYX_USE_TR1
#include <functional> #include <functional>
#ifdef __GNUC__
#include <tr1/functional>
#endif
namespace lyx namespace lyx
{ {
using std::tr1::bind; using std::tr1::bind;

24
src/support/checktr1.h Normal file
View File

@ -0,0 +1,24 @@
// -*- C++ -*-
/**
* \file checktr1.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Peter Kümmel
*
* Full author contact details are available in file CREDITS.
*/
#ifndef LYX_CHECKTR1_H
#define LYX_CHECKTR1_H
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#define LYX_USE_TR1
#endif
#if __GNUC__ == 4 && __GNUC_MINOR__ >= 4
#define LYX_USE_TR1
#endif
#endif

View File

@ -12,10 +12,17 @@
#ifndef LYX_SHARED_PTR_H #ifndef LYX_SHARED_PTR_H
#define LYX_SHARED_PTR_H #define LYX_SHARED_PTR_H
#if defined(_MSC_VER) && (_MSC_VER >= 1600) #include "checktr1.h"
#ifdef LYX_USE_TR1
#include <memory> #include <memory>
#ifdef __GNUC__
#include <tr1/memory>
#endif
namespace lyx namespace lyx
{ {
using std::tr1::shared_ptr; using std::tr1::shared_ptr;