diff --git a/DirectXTex/BC.h b/DirectXTex/BC.h index c653336..d46b232 100644 --- a/DirectXTex/BC.h +++ b/DirectXTex/BC.h @@ -71,7 +71,7 @@ class LDRColorA public: uint8_t r, g, b, a; - LDRColorA() {} + LDRColorA() DIRECTX_CTOR_DEFAULT LDRColorA(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a) : r(_r), g(_g), b(_b), a(_a) {} const uint8_t& operator [] (_In_range_(0,3) size_t uElement) const @@ -143,7 +143,7 @@ public: float r, g, b, a; public: - HDRColorA() {} + HDRColorA() DIRECTX_CTOR_DEFAULT HDRColorA(float _r, float _g, float _b, float _a) : r(_r), g(_g), b(_b), a(_a) {} HDRColorA(const HDRColorA& c) : r(c.r), g(c.g), b(c.b), a(c.a) {} HDRColorA(const LDRColorA& c) @@ -307,7 +307,7 @@ public: int pad; public: - INTColor() {} + INTColor() DIRECTX_CTOR_DEFAULT INTColor(int nr, int ng, int nb) {r = nr; g = ng; b = nb;} INTColor(const INTColor& c) {r = c.r; g = c.g; b = c.b;} diff --git a/DirectXTex/DirectXTex.h b/DirectXTex/DirectXTex.h index 51d5774..321435f 100644 --- a/DirectXTex/DirectXTex.h +++ b/DirectXTex/DirectXTex.h @@ -46,6 +46,17 @@ #endif #endif +// VS 2010/2012 do not support =default =delete +#ifndef DIRECTX_CTOR_DEFAULT +#if defined(_MSC_VER) && (_MSC_VER < 1800) +#define DIRECTX_CTOR_DEFAULT {} +#define DIRECTX_CTOR_DELETE ; +#else +#define DIRECTX_CTOR_DEFAULT =default; +#define DIRECTX_CTOR_DELETE =delete; +#endif +#endif + #define DIRECTX_TEX_VERSION 131 namespace DirectX @@ -577,7 +588,7 @@ namespace DirectX size_t w; size_t h; - Rect() {} + Rect() DIRECTX_CTOR_DEFAULT Rect( size_t _x, size_t _y, size_t _w, size_t _h ) : x(_x), y(_y), w(_w), h(_h) {} };