Hide warnings about non-virtual destructors from df-structures.

develop
Ben Lubar 2018-04-05 14:46:28 -05:00
parent 8a53ad543f
commit 9cbba0ae01
No known key found for this signature in database
GPG Key ID: 018BAB45DB2D2B24
1 changed files with 3 additions and 0 deletions

@ -423,12 +423,15 @@ namespace df
using DFHack::BitArray;
using DFHack::DfArray;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
template<class T>
void *allocator_fn(void *out, const void *in) {
if (out) { *(T*)out = *(const T*)in; return out; }
else if (in) { delete (T*)in; return (T*)in; }
else return new T();
}
#pragma GCC diagnostic pop
template<class T>
void *allocator_nodel_fn(void *out, const void *in) {