Author: kuemmel
Date: Sat Jun 5 13:06:13 2010
New Revision: 34600
URL: http://www.lyx.org/trac/changeset/34600
Log:
also use TR1 code for bind and shared_ptr when compiling with GCC >= 4.4
Added:
lyx-devel/trunk/src/support/checktr1.h (contents, props changed)
Modified:
lyx-devel/trunk/src/BufferList.cpp
lyx-devel/trunk/src/support/bind.h
lyx-devel/trunk/src/support/shared_ptr.h
Modified: lyx-devel/trunk/src/BufferList.cpp
==============================================================================
--- lyx-devel/trunk/src/BufferList.cpp Sat Jun 5 10:26:00 2010 (r34599)
+++ lyx-devel/trunk/src/BufferList.cpp Sat Jun 5 13:06:13 2010 (r34600)
@@ -37,7 +37,7 @@
#include <algorithm>
#include <functional>
#include <iterator>
-
+#include <memory>
using namespace std;
using namespace lyx::support;
Modified: lyx-devel/trunk/src/support/bind.h
==============================================================================
--- lyx-devel/trunk/src/support/bind.h Sat Jun 5 10:26:00 2010 (r34599)
+++ lyx-devel/trunk/src/support/bind.h Sat Jun 5 13:06:13 2010 (r34600)
@@ -12,10 +12,17 @@
#ifndef LYX_BIND_H
#define LYX_BIND_H
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+#include "checktr1.h"
+
+
+#ifdef LYX_USE_TR1
#include <functional>
+#ifdef __GNUC__
+#include <tr1/functional>
+#endif
+
namespace lyx
{
using std::tr1::bind;
Added: lyx-devel/trunk/src/support/checktr1.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ lyx-devel/trunk/src/support/checktr1.h Sat Jun 5 13:06:13 2010
(r34600)
@@ -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
Modified: lyx-devel/trunk/src/support/shared_ptr.h
==============================================================================
--- lyx-devel/trunk/src/support/shared_ptr.h Sat Jun 5 10:26:00 2010
(r34599)
+++ lyx-devel/trunk/src/support/shared_ptr.h Sat Jun 5 13:06:13 2010
(r34600)
@@ -12,10 +12,17 @@
#ifndef 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>
+#ifdef __GNUC__
+#include <tr1/memory>
+#endif
+
namespace lyx
{
using std::tr1::shared_ptr;