summaryrefslogtreecommitdiff
path: root/src/compat
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-26 21:59:27 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-26 22:28:22 -0700
commit2f4fc005937e75d931eb6ef87a3fe16364d45113 (patch)
tree2a60ea7b58e9a3045ec0e0754e075ae958e46409 /src/compat
parentf5fcb973cfad6221264a2a859f5236c3cef2c470 (diff)
downloadtmwa-2f4fc005937e75d931eb6ef87a3fe16364d45113.tar.gz
tmwa-2f4fc005937e75d931eb6ef87a3fe16364d45113.tar.bz2
tmwa-2f4fc005937e75d931eb6ef87a3fe16364d45113.tar.xz
tmwa-2f4fc005937e75d931eb6ef87a3fe16364d45113.zip
Stick everything in a namespace
Diffstat (limited to 'src/compat')
-rw-r--r--src/compat/attr.hpp3
-rw-r--r--src/compat/cast.cpp5
-rw-r--r--src/compat/cast.hpp3
-rw-r--r--src/compat/fun.hpp4
-rw-r--r--src/compat/fwd.hpp4
-rw-r--r--src/compat/iter.cpp5
-rw-r--r--src/compat/iter.hpp3
-rw-r--r--src/compat/iter_test.cpp3
-rw-r--r--src/compat/memory.cpp5
-rw-r--r--src/compat/memory.hpp3
-rw-r--r--src/compat/nullpo.cpp4
-rw-r--r--src/compat/nullpo.hpp4
-rw-r--r--src/compat/rawmem.cpp5
-rw-r--r--src/compat/rawmem.hpp4
-rw-r--r--src/compat/time_t.cpp5
-rw-r--r--src/compat/time_t.hpp5
16 files changed, 65 insertions, 0 deletions
diff --git a/src/compat/attr.hpp b/src/compat/attr.hpp
index 531e6b4..73fcfc4 100644
--- a/src/compat/attr.hpp
+++ b/src/compat/attr.hpp
@@ -22,10 +22,13 @@
# include "fwd.hpp"
+namespace tmwa
+{
# ifdef __clang__
# define FALLTHROUGH [[clang::fallthrough]]
# else
# define FALLTHROUGH /* fallthrough */
# endif
+} // namespace tmwa
#endif // TMWA_COMPAT_ATTR_HPP
diff --git a/src/compat/cast.cpp b/src/compat/cast.cpp
index 43c0b53..482529d 100644
--- a/src/compat/cast.cpp
+++ b/src/compat/cast.cpp
@@ -19,3 +19,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../poison.hpp"
+
+
+namespace tmwa
+{
+} // namespace tmwa
diff --git a/src/compat/cast.hpp b/src/compat/cast.hpp
index b237df4..38a8997 100644
--- a/src/compat/cast.hpp
+++ b/src/compat/cast.hpp
@@ -25,6 +25,8 @@
# include <type_traits>
+namespace tmwa
+{
template<class T>
const T& const_(T& t)
{
@@ -68,5 +70,6 @@ typename std::remove_pointer<T>::type *sign_cast(U *u)
static_assert(sizeof(T_) == sizeof(U), "sign cast must be same size");
return reinterpret_cast<T_ *>(u);
}
+} // namespace tmwa
#endif // TMWA_COMPAT_CAST_HPP
diff --git a/src/compat/fun.hpp b/src/compat/fun.hpp
index 072bda0..53a0ed6 100644
--- a/src/compat/fun.hpp
+++ b/src/compat/fun.hpp
@@ -23,6 +23,10 @@
# include <functional>
+
+namespace tmwa
+{
namespace ph = std::placeholders;
+} // namespace tmwa
#endif // TMWA_COMPAT_FUN_HPP
diff --git a/src/compat/fwd.hpp b/src/compat/fwd.hpp
index 46934b8..729b963 100644
--- a/src/compat/fwd.hpp
+++ b/src/compat/fwd.hpp
@@ -21,6 +21,10 @@
# include "../sanity.hpp"
+
+namespace tmwa
+{
// meh, add more when I feel like it
+} // namespace tmwa
#endif // TMWA_COMPAT_FWD_HPP
diff --git a/src/compat/iter.cpp b/src/compat/iter.cpp
index f0ab0af..b6d6b63 100644
--- a/src/compat/iter.cpp
+++ b/src/compat/iter.cpp
@@ -19,3 +19,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../poison.hpp"
+
+
+namespace tmwa
+{
+} // namespace tmwa
diff --git a/src/compat/iter.hpp b/src/compat/iter.hpp
index 08c139e..7ed24da 100644
--- a/src/compat/iter.hpp
+++ b/src/compat/iter.hpp
@@ -24,6 +24,8 @@
# include <iterator>
+namespace tmwa
+{
/// Simple class to use a pair of iterators with foreach
template<class It>
class IteratorPair
@@ -149,5 +151,6 @@ IteratorPair<FilterIterator<T, F, C>> filter_iterator(C *c, F f=is_truthy<T>)
{
return {FilterIterator<T, F, C>(c, f), FilterIterator<T, F, C>(c, f)};
}
+} // namespace tmwa
#endif // TMWA_COMPAT_ITER_HPP
diff --git a/src/compat/iter_test.cpp b/src/compat/iter_test.cpp
index f0e6031..71cc891 100644
--- a/src/compat/iter_test.cpp
+++ b/src/compat/iter_test.cpp
@@ -27,6 +27,8 @@
#include "../poison.hpp"
+namespace tmwa
+{
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
TEST(iterpair, strings)
@@ -158,3 +160,4 @@ TEST(iterpair, filter3)
EXPECT_EQ(sum, 6);
EXPECT_EQ(count, 3);
}
+} // namespace tmwa
diff --git a/src/compat/memory.cpp b/src/compat/memory.cpp
index 5db23b2..f9f2c22 100644
--- a/src/compat/memory.cpp
+++ b/src/compat/memory.cpp
@@ -19,3 +19,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../poison.hpp"
+
+
+namespace tmwa
+{
+} // namespace tmwa
diff --git a/src/compat/memory.hpp b/src/compat/memory.hpp
index 3a2af96..702951c 100644
--- a/src/compat/memory.hpp
+++ b/src/compat/memory.hpp
@@ -25,6 +25,8 @@
# include <type_traits>
+namespace tmwa
+{
template<class T>
struct is_array_of_unknown_bound
: std::is_same<T, typename std::remove_extent<T>::type[]>
@@ -42,5 +44,6 @@ typename std::enable_if<is_array_of_unknown_bound<T>::value, std::unique_ptr<T,
typedef typename std::remove_extent<T>::type E;
return std::unique_ptr<E[], D>(new E[sz]());
}
+} // namespace tmwa
#endif // TMWA_COMPAT_MEMORY_HPP
diff --git a/src/compat/nullpo.cpp b/src/compat/nullpo.cpp
index a31cc34..bb80b27 100644
--- a/src/compat/nullpo.cpp
+++ b/src/compat/nullpo.cpp
@@ -24,6 +24,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
/// Actual output function
static
void nullpo_info(const char *file, int line, const char *func)
@@ -46,3 +49,4 @@ bool nullpo_chk(const char *file, int line, const char *func,
nullpo_info(file, line, func);
return 1;
}
+} // namespace tmwa
diff --git a/src/compat/nullpo.hpp b/src/compat/nullpo.hpp
index 5de8ab6..6e12f78 100644
--- a/src/compat/nullpo.hpp
+++ b/src/compat/nullpo.hpp
@@ -45,6 +45,9 @@
# include "fwd.hpp"
+
+namespace tmwa
+{
/// Used by macros in this header
bool nullpo_chk(const char *file, int line, const char *func,
const void *target);
@@ -59,5 +62,6 @@ bool nullpo_chk(const char *file, int line, const char *func, T *target)
{
return nullpo_chk(file, line, func, static_cast<const void *>(target));
}
+} // namespace tmwa
#endif // TMWA_COMPAT_NULLPO_HPP
diff --git a/src/compat/rawmem.cpp b/src/compat/rawmem.cpp
index 74fdc0b..d322437 100644
--- a/src/compat/rawmem.cpp
+++ b/src/compat/rawmem.cpp
@@ -19,3 +19,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../poison.hpp"
+
+
+namespace tmwa
+{
+} // namespace tmwa
diff --git a/src/compat/rawmem.hpp b/src/compat/rawmem.hpp
index f030963..dd038be 100644
--- a/src/compat/rawmem.hpp
+++ b/src/compat/rawmem.hpp
@@ -25,6 +25,9 @@
# include "fwd.hpp"
+
+namespace tmwa
+{
inline
void really_memcpy(uint8_t *dest, const uint8_t *src, size_t n)
{
@@ -47,5 +50,6 @@ void really_memset0(uint8_t *dest, size_t n)
{
memset(dest, '\0', n);
}
+} // namespace tmwa
#endif // TMWA_COMPAT_RAWMEM_HPP
diff --git a/src/compat/time_t.cpp b/src/compat/time_t.cpp
index b1a3fb8..ee0bbde 100644
--- a/src/compat/time_t.cpp
+++ b/src/compat/time_t.cpp
@@ -19,3 +19,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../poison.hpp"
+
+
+namespace tmwa
+{
+} // namespace tmwa
diff --git a/src/compat/time_t.hpp b/src/compat/time_t.hpp
index 4e0ffb6..60005d0 100644
--- a/src/compat/time_t.hpp
+++ b/src/compat/time_t.hpp
@@ -24,4 +24,9 @@
// TODO fix this ordering violation by promoting TimeT here
# include "../mmo/utils.hpp"
+
+namespace tmwa
+{
+} // namespace tmwa
+
#endif // TMWA_COMPAT_TIMET_HPP