summaryrefslogtreecommitdiffstats
path: root/src/PYUtil.h
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-09-27 14:09:07 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-09-27 14:09:07 +0800
commita0b31c7a250cfa7af1b52056a1d1ada81b22a455 (patch)
tree8da3ce94a625c249e3e4b1ab81afcee7f4900236 /src/PYUtil.h
parent27c2f7ea0ef69094db2dfc009bb661276fc90227 (diff)
downloadibus-libpinyin-a0b31c7a250cfa7af1b52056a1d1ada81b22a455.tar.gz
ibus-libpinyin-a0b31c7a250cfa7af1b52056a1d1ada81b22a455.tar.xz
ibus-libpinyin-a0b31c7a250cfa7af1b52056a1d1ada81b22a455.zip
Add option --disable-boost to support build without boost
When build without boost, ibus-pinyin will use smart pointer from c++0x and use the signal templates embedded instead of boost::signals2. BUG=chromium-os:5055 TEST=manual Review URL: http://codereview.appspot.com/2205044
Diffstat (limited to 'src/PYUtil.h')
-rw-r--r--src/PYUtil.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/PYUtil.h b/src/PYUtil.h
index 1e22089..cb5f51b 100644
--- a/src/PYUtil.h
+++ b/src/PYUtil.h
@@ -35,6 +35,23 @@
#include <cstdlib>
#include <string>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <memory>
+#else
+# include <boost/shared_ptr.hpp>
+# include <boost/scoped_ptr.hpp>
+
+namespace std {
+ // import boost::shared_ptr to std namespace
+ using boost::shared_ptr;
+ // import boost::scoped_ptr to std namespace, and rename to unique_ptr
+ // XXX: the unique_ptr can transfer the pointer ownership,
+ // but scoped_ptr cannot.
+ template<typename T> class unique_ptr : public boost::scoped_ptr<T> {};
+};
+
+#endif
+
#include <ibus.h>
namespace PY {