blob: 40cc4bd24afbdced344c8761c30222c417624b0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
$NetBSD: patch-ac,v 1.2 2013/04/30 22:32:43 joerg Exp $
--- glibmm-utils/log-stream.cc.orig 2008-10-14 12:11:14.000000000 +0000
+++ glibmm-utils/log-stream.cc
@@ -26,7 +26,6 @@
#include <list>
#include <vector>
#include <fstream>
-#include <tr1/memory>
#include <glibmm.h>
#include <glibmm/thread.h>
#include <glib/gstdio.h>
@@ -36,11 +35,21 @@
#include "date.h"
#include "ustring.h"
+#ifndef __ASSERT_FUNCTION
+#define __ASSERT_FUNCTION __func__
+#endif
+
namespace Glib {
namespace Util {
using namespace std ;
+#ifdef _LIBCPP_VERSION
+using std::shared_ptr;
+#else
+using std::tr1::shared_ptr;
+#endif
+
static LogStream::StreamType s_stream_type = LogStream::COUT_STREAM ;
static LogStream::LogLevel s_level_filter = LogStream::LOG_LEVEL_NORMAL ;
static bool s_is_active = true ;
@@ -54,7 +63,7 @@ static bool s_is_active = true ;
class LogSink {
protected:
- mutable tr1::shared_ptr<Glib::Mutex> m_ostream_mutex ;
+ mutable shared_ptr<Glib::Mutex> m_ostream_mutex ;
ostream *m_out ;
//non copyable
@@ -206,7 +215,7 @@ public:
};//end class OStreamSink
class OfstreamLogSink : public LogSink {
- std::tr1::shared_ptr<ofstream> m_ofstream ;
+ shared_ptr<ofstream> m_ofstream ;
void init_from_path (const Glib::ustring &a_file_path)
{
@@ -250,7 +259,7 @@ public:
}
};//end class OfstreamLogSink
-typedef std::tr1::shared_ptr<LogSink> LogSinkSafePtr ;
+typedef shared_ptr<LogSink> LogSinkSafePtr ;
struct LogStream::Priv
{
enum LogStream::StreamType stream_type ;
|