forked from OctaForge/libostd
OCTA_ALLOW_CXXSTD to allow octastd to be used alongside stl (for transition and other projects)
parent
08bb790612
commit
9b98741c4d
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "octa/range.h"
|
#include "octa/range.h"
|
||||||
|
|
||||||
|
#ifndef OCTA_ALLOW_CXXSTD
|
||||||
/* must be in std namespace otherwise the compiler won't know about it */
|
/* must be in std namespace otherwise the compiler won't know about it */
|
||||||
namespace std {
|
namespace std {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -37,6 +38,9 @@ namespace std {
|
||||||
const T *end() const { return p_buf + p_len; }
|
const T *end() const { return p_buf + p_len; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#include <initializer_list>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace octa {
|
namespace octa {
|
||||||
template<typename T> using InitializerList = std::initializer_list<T>;
|
template<typename T> using InitializerList = std::initializer_list<T>;
|
||||||
|
|
|
@ -8,9 +8,11 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#ifndef OCTA_ALLOW_CXXSTD
|
||||||
inline void *operator new (size_t, void *p) { return p; }
|
inline void *operator new (size_t, void *p) { return p; }
|
||||||
inline void *operator new [](size_t, void *p) { return p; }
|
inline void *operator new [](size_t, void *p) { return p; }
|
||||||
inline void operator delete (void *, void *) {}
|
inline void operator delete (void *, void *) {}
|
||||||
inline void operator delete[](void *, void *) {}
|
inline void operator delete[](void *, void *) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue