mirror of
https://gitlab.com/niansa/frigg.git
synced 2025-03-06 20:53:32 +01:00
Fixed clang compatibility
This commit is contained in:
parent
a8e3364e42
commit
46da5578a2
1 changed files with 16 additions and 1 deletions
|
@ -1,8 +1,10 @@
|
|||
#pragma once
|
||||
#include <cstddef>
|
||||
|
||||
namespace frg {
|
||||
|
||||
struct stl_allocator {
|
||||
# ifndef __clang__
|
||||
void *allocate(size_t size) {
|
||||
return operator new(size);
|
||||
}
|
||||
|
@ -13,7 +15,20 @@ struct stl_allocator {
|
|||
|
||||
void free(void *ptr) {
|
||||
operator delete(ptr);
|
||||
}
|
||||
}
|
||||
# else
|
||||
void *allocate(size_t size) {
|
||||
return operator new(size);
|
||||
}
|
||||
|
||||
void deallocate(void *ptr, size_t size) {
|
||||
operator delete(ptr);
|
||||
}
|
||||
|
||||
void free(void *ptr) {
|
||||
operator delete(ptr);
|
||||
}
|
||||
# endif
|
||||
};
|
||||
|
||||
} // namespace frg
|
||||
|
|
Loading…
Add table
Reference in a new issue