mirror of
https://github.com/ceph/ceph
synced 2025-03-06 00:10:04 +00:00
libc++: create portable smart ptr / hash_map/set
Creates ceph:: namespaced versions of smart pointers and unordered map and sets. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
parent
47bc71a7b4
commit
8e8672047c
@ -81,4 +81,8 @@ noinst_HEADERS += \
|
||||
include/rbd/librbd.hpp\
|
||||
include/util.h\
|
||||
include/stat.h \
|
||||
include/on_exit.h
|
||||
include/on_exit.h \
|
||||
include/memory.h \
|
||||
include/hash_namespace.h \
|
||||
include/unordered_set.h \
|
||||
include/unordered_map.h
|
||||
|
24
src/include/hash_namespace.h
Normal file
24
src/include/hash_namespace.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef CEPH_HASH_NAMESPACE_H
|
||||
#define CEPH_HASH_NAMESPACE_H
|
||||
|
||||
#include <ciso646>
|
||||
|
||||
#ifdef _LIBCPP_VERSION
|
||||
|
||||
#include <functional>
|
||||
|
||||
#define CEPH_HASH_NAMESPACE_START namespace std {
|
||||
#define CEPH_HASH_NAMESPACE_END }
|
||||
#define CEPH_HASH_NAMESPACE std
|
||||
|
||||
#else
|
||||
|
||||
#include <tr1/functional>
|
||||
|
||||
#define CEPH_HASH_NAMESPACE_START namespace std { namespace tr1 {
|
||||
#define CEPH_HASH_NAMESPACE_END }}
|
||||
#define CEPH_HASH_NAMESPACE std::tr1
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
26
src/include/memory.h
Normal file
26
src/include/memory.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef CEPH_MEMORY_H
|
||||
#define CEPH_MEMORY_H
|
||||
|
||||
#include <ciso646>
|
||||
|
||||
#ifdef _LIBCPP_VERSION
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace ceph {
|
||||
using std::shared_ptr;
|
||||
using std::weak_ptr;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <tr1/memory>
|
||||
|
||||
namespace ceph {
|
||||
using std::tr1::shared_ptr;
|
||||
using std::tr1::weak_ptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
24
src/include/unordered_map.h
Normal file
24
src/include/unordered_map.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef CEPH_UNORDERED_MAP_H
|
||||
#define CEPH_UNORDERED_MAP_H
|
||||
|
||||
#include <ciso646>
|
||||
|
||||
#ifdef _LIBCPP_VERSION
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace ceph {
|
||||
using std::unordered_map;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <tr1/unordered_map>
|
||||
|
||||
namespace ceph {
|
||||
using std::tr1::unordered_map;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
24
src/include/unordered_set.h
Normal file
24
src/include/unordered_set.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef CEPH_UNORDERED_SET_H
|
||||
#define CEPH_UNORDERED_SET_H
|
||||
|
||||
#include <ciso646>
|
||||
|
||||
#ifdef _LIBCPP_VERSION
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
namespace ceph {
|
||||
using std::unordered_set;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <tr1/unordered_set>
|
||||
|
||||
namespace ceph {
|
||||
using std::tr1::unordered_set;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user