diff --git a/aegisub/libaegisub/include/libaegisub/scoped_ptr.h b/aegisub/libaegisub/include/libaegisub/scoped_ptr.h index be8cc8f51..249f01f8f 100644 --- a/aegisub/libaegisub/include/libaegisub/scoped_ptr.h +++ b/aegisub/libaegisub/include/libaegisub/scoped_ptr.h @@ -20,6 +20,10 @@ #pragma once +#ifndef LAGI_PRE +#include +#endif + namespace agi { /// @class scoped_ptr @@ -36,14 +40,14 @@ public: T* operator->() const { return ptr; } T* get() const { return ptr; } - void reset(T *p = NULL) { + void reset(T *p = 0) { delete ptr; ptr = p; } void swap(scoped_ptr &b) { using std::swap; swap(ptr, b.ptr); } - explicit scoped_ptr(T *ptr = NULL) : ptr(ptr){ } + explicit scoped_ptr(T *ptr = 0) : ptr(ptr){ } ~scoped_ptr() { delete ptr; } };