From 7ba84588185ff892d2bb80fe8e73d44886d14ed6 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 29 Jan 2019 00:49:07 +0100 Subject: [PATCH] Remove old feature macros that are no longer relevant nowadays. --- src/gpu/vertexbuffer.cpp | 4 - src/lol/base/features.h | 52 ++++------- src/lol/gpu/vertexbuffer.h | 6 +- src/lol/math/matrix.h | 16 +--- src/lol/math/transform.h | 10 +-- src/lol/math/vector.h | 172 ++++++++++++++++--------------------- src/t/base/types.cpp | 4 +- src/t/math/vector.cpp | 4 +- 8 files changed, 97 insertions(+), 171 deletions(-) diff --git a/src/gpu/vertexbuffer.cpp b/src/gpu/vertexbuffer.cpp index 681a508a..a920646a 100644 --- a/src/gpu/vertexbuffer.cpp +++ b/src/gpu/vertexbuffer.cpp @@ -221,9 +221,7 @@ void VertexDeclaration::SetStream(VertexBuffer *vb, ShaderAttrib attribs[]) static struct { GLint size; GLenum type; } const tlut[] = { { 0, 0 }, -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, /* half */ -#endif { 1, GL_FLOAT }, { 2, GL_FLOAT }, { 3, GL_FLOAT }, { 4, GL_FLOAT }, /* float */ { 1, GL_DOUBLE }, { 2, GL_DOUBLE }, { 3, GL_DOUBLE }, @@ -316,9 +314,7 @@ VertexStreamBase VertexDeclaration::GetStream(int index) const case VertexStreamBase::Type##T: stream.AddStream(n++, m_streams[i].usage); break; __T(void) -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS __T(half) __T(f16vec2) __T(f16vec3) __T(f16vec4) -#endif __T(float) __T(vec2) __T(vec3) __T(vec4) __T(double) __T(dvec2) __T(dvec3) __T(dvec4) __T(int8_t) __T(i8vec2) __T(i8vec3) __T(i8vec4) diff --git a/src/lol/base/features.h b/src/lol/base/features.h index bcebbd99..95a4d869 100644 --- a/src/lol/base/features.h +++ b/src/lol/base/features.h @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010—2015 Sam Hocevar +// Copyright © 2010—2019 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -22,28 +22,18 @@ */ #define LOL_FEATURE_THREADS 1 -#define LOL_FEATURE_VISUAL_STUDIO_THAT_FUCKING_PIECE_OF_SHIT_COMPILER 0 #if defined EMSCRIPTEN # undef LOL_FEATURE_THREADS #endif -/* Use this to disable code that causes compiler crashes. */ -#if defined _MSC_VER -# undef LOL_FEATURE_VISUAL_STUDIO_THAT_FUCKING_PIECE_OF_SHIT_COMPILER -# define LOL_FEATURE_VISUAL_STUDIO_THAT_FUCKING_PIECE_OF_SHIT_COMPILER 1 -#endif - - /* * Check for C++11 and later features. */ /* These features aren't necessarily supported by all compilers */ -#undef LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS #undef LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS #undef LOL_FEATURE_CXX11_ARRAY_INITIALIZERS -#undef LOL_FEATURE_CXX11_CONSTEXPR #undef LOL_FEATURE_CXX11_ISNAN /* FIXME: is this the right place? */ #undef LOL_FEATURE_CXX11_NULLPTR #undef LOL_FEATURE_CXX11_TEMPLATE_ALIASES @@ -64,15 +54,14 @@ /* Features supported by GCC */ #if defined __GNUC__ -# define LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS 1 -# define LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS 1 -# if defined(__GXX_EXPERIMENTAL_CXX0X) || __cplusplus >= 201103L -# define LOL_FEATURE_CXX11_CONSTEXPR 1 -# define LOL_FEATURE_CXX11_ISNAN 1 -# define LOL_FEATURE_CXX11_ARRAY_INITIALIZERS 1 -# define LOL_FEATURE_CXX11_NULLPTR 1 -# define LOL_FEATURE_CXX11_SFINAE_FOR_CTORS 1 +# if !defined(__GXX_EXPERIMENTAL_CXX0X) && __cplusplus < 201103L +# error "sorry, this version of GCC does not support constexpr" # endif +# define LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS 1 +# define LOL_FEATURE_CXX11_ISNAN 1 +# define LOL_FEATURE_CXX11_ARRAY_INITIALIZERS 1 +# define LOL_FEATURE_CXX11_NULLPTR 1 +# define LOL_FEATURE_CXX11_SFINAE_FOR_CTORS 1 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 470 # define LOL_FEATURE_CXX11_TEMPLATE_ALIASES 1 # endif @@ -80,11 +69,10 @@ /* Features supported by Clang */ #if !defined __GNUC__ && defined __has_feature -# define LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS 1 # define LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS 1 # define LOL_FEATURE_CXX11_ARRAY_INITIALIZERS 1 -# if __has_feature(cxx_constexpr) -# define LOL_FEATURE_CXX11_CONSTEXPR 1 +# if !__has_feature(cxx_constexpr) +# error "sorry, this version of clang does not support constexpr" # endif # define LOL_FEATURE_CXX11_ISNAN 1 # if __has_feature(cxx_nullptr) @@ -96,21 +84,15 @@ /* Features supported by Visual Studio */ #if defined _MSC_VER +# if _MSC_VER < 1910 +# error "sorry, Visual Studio 2017 or later is needed" +# endif # define LOL_FEATURE_CXX11_TEMPLATE_ALIASES 1 # define LOL_FEATURE_CXX11_ISNAN 1 -# if _MSC_VER >= 1900 /* 2015 CTP (not too bad) */ -# define LOL_FEATURE_CXX11_NULLPTR 1 -# define LOL_FEATURE_CXX11_SFINAE_FOR_CTORS 1 -# define LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS 1 -# endif -# if _MSC_VER < 1800 /* 2012 or older (ugly piece of shit) */ -# error "sorry, Visual Studio 2013 or later is needed" -# endif - /* Supported in VS 2015 but causes massive warning output */ -# undef LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS - /* Still unsupported as of VS 2015 (TODO: check VS2017) */ -# undef LOL_FEATURE_CXX11_ARRAY_INITIALIZERS -# undef LOL_FEATURE_CXX11_CONSTEXPR +# define LOL_FEATURE_CXX11_NULLPTR 1 +# define LOL_FEATURE_CXX11_SFINAE_FOR_CTORS 1 +# define LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS 1 +# define LOL_FEATURE_CXX11_ARRAY_INITIALIZERS 1 #endif diff --git a/src/lol/gpu/vertexbuffer.h b/src/lol/gpu/vertexbuffer.h index 16cab021..f44a84d0 100644 --- a/src/lol/gpu/vertexbuffer.h +++ b/src/lol/gpu/vertexbuffer.h @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010—2018 Sam Hocevar +// Copyright © 2010—2019 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -76,9 +76,7 @@ public: /* XXX: be sure to fix all appropriate places in vertexbuffer.cpp * when modifying this list. */ Typevoid = 0, -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS Typehalf, Typef16vec2, Typef16vec3, Typef16vec4, -#endif Typefloat, Typevec2, Typevec3, Typevec4, Typedouble, Typedvec2, Typedvec3, Typedvec4, Typeint8_t, Typei8vec2, Typei8vec3, Typei8vec4, @@ -125,9 +123,7 @@ protected: static uint8_t GetType(T *x) { UNUSED(x); return Type##T; } __T(void) -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS __T(half) __T(f16vec2) __T(f16vec3) __T(f16vec4) -#endif __T(float) __T(vec2) __T(vec3) __T(vec4) __T(double) __T(dvec2) __T(dvec3) __T(dvec4) __T(int8_t) __T(i8vec2) __T(i8vec3) __T(i8vec4) diff --git a/src/lol/math/matrix.h b/src/lol/math/matrix.h index 12018d2f..9b604c7b 100644 --- a/src/lol/math/matrix.h +++ b/src/lol/math/matrix.h @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010—2015 Sam Hocevar +// Copyright © 2010—2019 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -32,10 +32,6 @@ namespace lol { -#if !LOL_FEATURE_CXX11_CONSTEXPR -# define constexpr /* */ -#endif - /* * The generic “mat_t” type, which is fixed-size */ @@ -153,9 +149,7 @@ private: }; static_assert(sizeof(imat2) == 16, "sizeof(imat2) == 16"); -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16mat2) == 8, "sizeof(f16mat2) == 8"); -#endif static_assert(sizeof(mat2) == 16, "sizeof(mat2) == 16"); static_assert(sizeof(dmat2) == 32, "sizeof(dmat2) == 32"); @@ -280,9 +274,7 @@ private: }; static_assert(sizeof(imat3) == 36, "sizeof(imat3) == 36"); -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16mat3) == 18, "sizeof(f16mat3) == 18"); -#endif static_assert(sizeof(mat3) == 36, "sizeof(mat3) == 36"); static_assert(sizeof(dmat3) == 72, "sizeof(dmat3) == 72"); @@ -456,9 +448,7 @@ private: }; static_assert(sizeof(imat4) == 64, "sizeof(imat4) == 64"); -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16mat4) == 32, "sizeof(f16mat4) == 32"); -#endif static_assert(sizeof(mat4) == 64, "sizeof(mat4) == 64"); static_assert(sizeof(dmat4) == 128, "sizeof(dmat4) == 128"); @@ -846,10 +836,6 @@ mat_t const mat_t::identity = mat_t((T)1); template mat_t const mat_t::identity = mat_t((T)1); -#if !LOL_FEATURE_CXX11_CONSTEXPR -#undef constexpr -#endif - } /* namespace lol */ #if _WIN32 diff --git a/src/lol/math/transform.h b/src/lol/math/transform.h index d7b69afa..35a08192 100644 --- a/src/lol/math/transform.h +++ b/src/lol/math/transform.h @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010—2015 Sam Hocevar +// Copyright © 2010—2019 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -22,10 +22,6 @@ namespace lol { -#if !LOL_FEATURE_CXX11_CONSTEXPR -# define constexpr /* */ -#endif - /* * 2-element transforms: complex numbers */ @@ -497,9 +493,5 @@ static inline sqt_t operator /(sqt_t const &x, sqt_t const &y) return x * inverse(y); } -#if !LOL_FEATURE_CXX11_CONSTEXPR -#undef constexpr -#endif - } /* namespace lol */ diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index 2efa4f4e..2e6d9f4d 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010—2015 Sam Hocevar +// Copyright © 2010—2019 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -29,16 +29,6 @@ namespace lol { -#if !LOL_FEATURE_CXX11_CONSTEXPR -# define constexpr /* */ -#endif - -#if !LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS -# define _____ const -#else -# define _____ /* */ -#endif - /* * Magic vector swizzling * @@ -70,7 +60,6 @@ struct LOL_ATTR_NODISCARD vec_t /* Disable all default constructors and destructors; this object * is only intended to exist as part of a union. */ -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS vec_t() = delete; vec_t(vec_t const &) = delete; ~vec_t() = delete; @@ -88,7 +77,6 @@ struct LOL_ATTR_NODISCARD vec_t /* Pass by value in case this == &that */ return *this = (vec_t)that; } -#endif inline T& operator[](size_t n) { @@ -286,8 +274,8 @@ struct LOL_ATTR_NODISCARD vec_t #if !_DOXYGEN_SKIP_ME vec_t const xx, rr, ss/**/, ww; - vec_t _____ xy, rg, st, rt, wh; - vec_t _____ yx, gr, ts, tr, hw; + vec_t const xy, rg, st, rt, wh; + vec_t const yx, gr, ts, tr, hw; vec_t const yy, gg, tt/**/, hh; vec_t const xxx, rrr, sss /**/, www; @@ -326,9 +314,7 @@ static_assert(sizeof(i16vec2) == 4, "sizeof(i16vec2) == 4"); static_assert(sizeof(ivec2) == 8, "sizeof(ivec2) == 8"); static_assert(sizeof(i64vec2) == 16, "sizeof(i64vec2) == 16"); -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16vec2) == 4, "sizeof(f16vec2) == 4"); -#endif static_assert(sizeof(vec2) == 8, "sizeof(vec2) == 8"); static_assert(sizeof(dvec2) == 16, "sizeof(dvec2) == 16"); @@ -443,13 +429,13 @@ struct LOL_ATTR_NODISCARD vec_t #if !_DOXYGEN_SKIP_ME vec_t const xx, rr, ss/**/, ww; - vec_t _____ xy, rg, st, rt, wh; - vec_t _____ xz, rb, sp, rp, wd; - vec_t _____ yx, gr, ts, tr, hw; + vec_t const xy, rg, st, rt, wh; + vec_t const xz, rb, sp, rp, wd; + vec_t const yx, gr, ts, tr, hw; vec_t const yy, gg, tt/**/, hh; - vec_t _____ yz, gb, tp/**/, hd; - vec_t _____ zx, br, ps, pr, dw; - vec_t _____ zy, bg, pt/**/, dh; + vec_t const yz, gb, tp/**/, hd; + vec_t const zx, br, ps, pr, dw; + vec_t const zy, bg, pt/**/, dh; vec_t const zz, bb, pp/**/, dd; vec_t const xxx, rrr, sss /**/, www; @@ -457,23 +443,23 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const xxz, rrb, ssp, rrp, wwd; vec_t const xyx, rgr, sts, rtr, whw; vec_t const xyy, rgg, stt, rtt, whh; - vec_t _____ xyz, rgb, stp, rtp, whd; + vec_t const xyz, rgb, stp, rtp, whd; vec_t const xzx, rbr, sps, rpr, wdw; - vec_t _____ xzy, rbg, spt, rpt, wdh; + vec_t const xzy, rbg, spt, rpt, wdh; vec_t const xzz, rbb, spp, rpp, wdd; vec_t const yxx, grr, tss, trr, hww; vec_t const yxy, grg, tst, trt, hwh; - vec_t _____ yxz, grb, tsp, trp, hwd; + vec_t const yxz, grb, tsp, trp, hwd; vec_t const yyx, ggr, tts, ttr, hhw; vec_t const yyy, ggg, ttt /**/, hhh; vec_t const yyz, ggb, ttp /**/, hhd; - vec_t _____ yzx, gbr, tps, tpr, hdw; + vec_t const yzx, gbr, tps, tpr, hdw; vec_t const yzy, gbg, tpt /**/, hdh; vec_t const yzz, gbb, tpp /**/, hdd; vec_t const zxx, brr, pss, prr, dww; - vec_t _____ zxy, brg, pst, prt, dwh; + vec_t const zxy, brg, pst, prt, dwh; vec_t const zxz, brb, psp, prp, dwd; - vec_t _____ zyx, bgr, pts, ptr, dhw; + vec_t const zyx, bgr, pts, ptr, dhw; vec_t const zyy, bgg, ptt /**/, dhh; vec_t const zyz, bgb, ptp /**/, dhd; vec_t const zzx, bbr, pps, ppr, ddw; @@ -572,9 +558,7 @@ static_assert(sizeof(i16vec3) == 6, "sizeof(i16vec3) == 6"); static_assert(sizeof(ivec3) == 12, "sizeof(ivec3) == 12"); static_assert(sizeof(i64vec3) == 24, "sizeof(i64vec3) == 24"); -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16vec3) == 6, "sizeof(f16vec3) == 6"); -#endif static_assert(sizeof(vec3) == 12, "sizeof(vec3) == 12"); static_assert(sizeof(dvec3) == 24, "sizeof(dvec3) == 24"); @@ -663,20 +647,20 @@ struct LOL_ATTR_NODISCARD vec_t #if !_DOXYGEN_SKIP_ME vec_t const xx, rr, ss; - vec_t _____ xy, rg, st; - vec_t _____ xz, rb, sp; - vec_t _____ xw, ra, sq; - vec_t _____ yx, gr, ts; + vec_t const xy, rg, st; + vec_t const xz, rb, sp; + vec_t const xw, ra, sq; + vec_t const yx, gr, ts; vec_t const yy, gg, tt; - vec_t _____ yz, gb, tp; - vec_t _____ yw, ga, tq; - vec_t _____ zx, br, ps; - vec_t _____ zy, bg, pt; + vec_t const yz, gb, tp; + vec_t const yw, ga, tq; + vec_t const zx, br, ps; + vec_t const zy, bg, pt; vec_t const zz, bb, pp; - vec_t _____ zw, ba, pq; - vec_t _____ wx, ar, qs; - vec_t _____ wy, ag, qt; - vec_t _____ wz, ab, qp; + vec_t const zw, ba, pq; + vec_t const wx, ar, qs; + vec_t const wy, ag, qt; + vec_t const wz, ab, qp; vec_t const ww, aa, qq; vec_t const xxx, rrr, sss; @@ -685,58 +669,58 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const xxw, rra, ssq; vec_t const xyx, rgr, sts; vec_t const xyy, rgg, stt; - vec_t _____ xyz, rgb, stp; - vec_t _____ xyw, rga, stq; + vec_t const xyz, rgb, stp; + vec_t const xyw, rga, stq; vec_t const xzx, rbr, sps; - vec_t _____ xzy, rbg, spt; + vec_t const xzy, rbg, spt; vec_t const xzz, rbb, spp; - vec_t _____ xzw, rba, spq; + vec_t const xzw, rba, spq; vec_t const xwx, rar, sqs; - vec_t _____ xwy, rag, sqt; - vec_t _____ xwz, rab, sqp; + vec_t const xwy, rag, sqt; + vec_t const xwz, rab, sqp; vec_t const xww, raa, sqq; vec_t const yxx, grr, tss; vec_t const yxy, grg, tst; - vec_t _____ yxz, grb, tsp; - vec_t _____ yxw, gra, tsq; + vec_t const yxz, grb, tsp; + vec_t const yxw, gra, tsq; vec_t const yyx, ggr, tts; vec_t const yyy, ggg, ttt; vec_t const yyz, ggb, ttp; vec_t const yyw, gga, ttq; - vec_t _____ yzx, gbr, tps; + vec_t const yzx, gbr, tps; vec_t const yzy, gbg, tpt; vec_t const yzz, gbb, tpp; - vec_t _____ yzw, gba, tpq; - vec_t _____ ywx, gar, tqs; + vec_t const yzw, gba, tpq; + vec_t const ywx, gar, tqs; vec_t const ywy, gag, tqt; - vec_t _____ ywz, gab, tqp; + vec_t const ywz, gab, tqp; vec_t const yww, gaa, tqq; vec_t const zxx, brr, pss; - vec_t _____ zxy, brg, pst; + vec_t const zxy, brg, pst; vec_t const zxz, brb, psp; - vec_t _____ zxw, bra, psq; - vec_t _____ zyx, bgr, pts; + vec_t const zxw, bra, psq; + vec_t const zyx, bgr, pts; vec_t const zyy, bgg, ptt; vec_t const zyz, bgb, ptp; - vec_t _____ zyw, bga, ptq; + vec_t const zyw, bga, ptq; vec_t const zzx, bbr, pps; vec_t const zzy, bbg, ppt; vec_t const zzz, bbb, ppp; vec_t const zzw, bba, ppq; - vec_t _____ zwx, bar, pqs; - vec_t _____ zwy, bag, pqt; + vec_t const zwx, bar, pqs; + vec_t const zwy, bag, pqt; vec_t const zwz, bab, pqp; vec_t const zww, baa, pqq; vec_t const wxx, arr, qss; - vec_t _____ wxy, arg, qst; - vec_t _____ wxz, arb, qsp; + vec_t const wxy, arg, qst; + vec_t const wxz, arb, qsp; vec_t const wxw, ara, qsq; - vec_t _____ wyx, agr, qts; + vec_t const wyx, agr, qts; vec_t const wyy, agg, qtt; - vec_t _____ wyz, agb, qtp; + vec_t const wyz, agb, qtp; vec_t const wyw, aga, qtq; - vec_t _____ wzx, abr, qps; - vec_t _____ wzy, abg, qpt; + vec_t const wzx, abr, qps; + vec_t const wzy, abg, qpt; vec_t const wzz, abb, qpp; vec_t const wzw, aba, qpq; vec_t const wwx, aar, qqs; @@ -771,10 +755,10 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const xyzx, rgbr, stps; vec_t const xyzy, rgbg, stpt; vec_t const xyzz, rgbb, stpp; - vec_t _____ xyzw, rgba, stpq; + vec_t const xyzw, rgba, stpq; vec_t const xywx, rgar, stqs; vec_t const xywy, rgag, stqt; - vec_t _____ xywz, rgab, stqp; + vec_t const xywz, rgab, stqp; vec_t const xyww, rgaa, stqq; vec_t const xzxx, rbrr, spss; vec_t const xzxy, rbrg, spst; @@ -783,13 +767,13 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const xzyx, rbgr, spts; vec_t const xzyy, rbgg, sptt; vec_t const xzyz, rbgb, sptp; - vec_t _____ xzyw, rbga, sptq; + vec_t const xzyw, rbga, sptq; vec_t const xzzx, rbbr, spps; vec_t const xzzy, rbbg, sppt; vec_t const xzzz, rbbb, sppp; vec_t const xzzw, rbba, sppq; vec_t const xzwx, rbar, spqs; - vec_t _____ xzwy, rbag, spqt; + vec_t const xzwy, rbag, spqt; vec_t const xzwz, rbab, spqp; vec_t const xzww, rbaa, spqq; vec_t const xwxx, rarr, sqss; @@ -798,10 +782,10 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const xwxw, rara, sqsq; vec_t const xwyx, ragr, sqts; vec_t const xwyy, ragg, sqtt; - vec_t _____ xwyz, ragb, sqtp; + vec_t const xwyz, ragb, sqtp; vec_t const xwyw, raga, sqtq; vec_t const xwzx, rabr, sqps; - vec_t _____ xwzy, rabg, sqpt; + vec_t const xwzy, rabg, sqpt; vec_t const xwzz, rabb, sqpp; vec_t const xwzw, raba, sqpq; vec_t const xwwx, raar, sqqs; @@ -819,10 +803,10 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const yxzx, grbr, tsps; vec_t const yxzy, grbg, tspt; vec_t const yxzz, grbb, tspp; - vec_t _____ yxzw, grba, tspq; + vec_t const yxzw, grba, tspq; vec_t const yxwx, grar, tsqs; vec_t const yxwy, grag, tsqt; - vec_t _____ yxwz, grab, tsqp; + vec_t const yxwz, grab, tsqp; vec_t const yxww, graa, tsqq; vec_t const yyxx, ggrr, ttss; vec_t const yyxy, ggrg, ttst; @@ -843,7 +827,7 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const yzxx, gbrr, tpss; vec_t const yzxy, gbrg, tpst; vec_t const yzxz, gbrb, tpsp; - vec_t _____ yzxw, gbra, tpsq; + vec_t const yzxw, gbra, tpsq; vec_t const yzyx, gbgr, tpts; vec_t const yzyy, gbgg, tptt; vec_t const yzyz, gbgb, tptp; @@ -852,19 +836,19 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const yzzy, gbbg, tppt; vec_t const yzzz, gbbb, tppp; vec_t const yzzw, gbba, tppq; - vec_t _____ yzwx, gbar, tpqs; + vec_t const yzwx, gbar, tpqs; vec_t const yzwy, gbag, tpqt; vec_t const yzwz, gbab, tpqp; vec_t const yzww, gbaa, tpqq; vec_t const ywxx, garr, tqss; vec_t const ywxy, garg, tqst; - vec_t _____ ywxz, garb, tqsp; + vec_t const ywxz, garb, tqsp; vec_t const ywxw, gara, tqsq; vec_t const ywyx, gagr, tqts; vec_t const ywyy, gagg, tqtt; vec_t const ywyz, gagb, tqtp; vec_t const ywyw, gaga, tqtq; - vec_t _____ ywzx, gabr, tqps; + vec_t const ywzx, gabr, tqps; vec_t const ywzy, gabg, tqpt; vec_t const ywzz, gabb, tqpp; vec_t const ywzw, gaba, tqpq; @@ -879,19 +863,19 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const zxyx, brgr, psts; vec_t const zxyy, brgg, pstt; vec_t const zxyz, brgb, pstp; - vec_t _____ zxyw, brga, pstq; + vec_t const zxyw, brga, pstq; vec_t const zxzx, brbr, psps; vec_t const zxzy, brbg, pspt; vec_t const zxzz, brbb, pspp; vec_t const zxzw, brba, pspq; vec_t const zxwx, brar, psqs; - vec_t _____ zxwy, brag, psqt; + vec_t const zxwy, brag, psqt; vec_t const zxwz, brab, psqp; vec_t const zxww, braa, psqq; vec_t const zyxx, bgrr, ptss; vec_t const zyxy, bgrg, ptst; vec_t const zyxz, bgrb, ptsp; - vec_t _____ zyxw, bgra, ptsq; + vec_t const zyxw, bgra, ptsq; vec_t const zyyx, bggr, ptts; vec_t const zyyy, bggg, pttt; vec_t const zyyz, bggb, pttp; @@ -900,7 +884,7 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const zyzy, bgbg, ptpt; vec_t const zyzz, bgbb, ptpp; vec_t const zyzw, bgba, ptpq; - vec_t _____ zywx, bgar, ptqs; + vec_t const zywx, bgar, ptqs; vec_t const zywy, bgag, ptqt; vec_t const zywz, bgab, ptqp; vec_t const zyww, bgaa, ptqq; @@ -921,10 +905,10 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const zzwz, bbab, ppqp; vec_t const zzww, bbaa, ppqq; vec_t const zwxx, barr, pqss; - vec_t _____ zwxy, barg, pqst; + vec_t const zwxy, barg, pqst; vec_t const zwxz, barb, pqsp; vec_t const zwxw, bara, pqsq; - vec_t _____ zwyx, bagr, pqts; + vec_t const zwyx, bagr, pqts; vec_t const zwyy, bagg, pqtt; vec_t const zwyz, bagb, pqtp; vec_t const zwyw, baga, pqtq; @@ -942,10 +926,10 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const wxxw, arra, qssq; vec_t const wxyx, argr, qsts; vec_t const wxyy, argg, qstt; - vec_t _____ wxyz, argb, qstp; + vec_t const wxyz, argb, qstp; vec_t const wxyw, arga, qstq; vec_t const wxzx, arbr, qsps; - vec_t _____ wxzy, arbg, qspt; + vec_t const wxzy, arbg, qspt; vec_t const wxzz, arbb, qspp; vec_t const wxzw, arba, qspq; vec_t const wxwx, arar, qsqs; @@ -954,13 +938,13 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const wxww, araa, qsqq; vec_t const wyxx, agrr, qtss; vec_t const wyxy, agrg, qtst; - vec_t _____ wyxz, agrb, qtsp; + vec_t const wyxz, agrb, qtsp; vec_t const wyxw, agra, qtsq; vec_t const wyyx, aggr, qtts; vec_t const wyyy, aggg, qttt; vec_t const wyyz, aggb, qttp; vec_t const wyyw, agga, qttq; - vec_t _____ wyzx, agbr, qtps; + vec_t const wyzx, agbr, qtps; vec_t const wyzy, agbg, qtpt; vec_t const wyzz, agbb, qtpp; vec_t const wyzw, agba, qtpq; @@ -969,10 +953,10 @@ struct LOL_ATTR_NODISCARD vec_t vec_t const wywz, agab, qtqp; vec_t const wyww, agaa, qtqq; vec_t const wzxx, abrr, qpss; - vec_t _____ wzxy, abrg, qpst; + vec_t const wzxy, abrg, qpst; vec_t const wzxz, abrb, qpsp; vec_t const wzxw, abra, qpsq; - vec_t _____ wzyx, abgr, qpts; + vec_t const wzyx, abgr, qpts; vec_t const wzyy, abgg, qptt; vec_t const wzyz, abgb, qptp; vec_t const wzyw, abga, qptq; @@ -1011,9 +995,7 @@ static_assert(sizeof(i16vec4) == 8, "sizeof(i16vec4) == 8"); static_assert(sizeof(ivec4) == 16, "sizeof(ivec4) == 16"); static_assert(sizeof(i64vec4) == 32, "sizeof(i64vec4) == 32"); -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16vec4) == 8, "sizeof(f16vec4) == 8"); -#endif static_assert(sizeof(vec4) == 16, "sizeof(vec4) == 16"); static_assert(sizeof(dvec4) == 32, "sizeof(dvec4) == 32"); @@ -1385,9 +1367,5 @@ vec_t const vec_t::axis_z = vec_t(T(0), T(0), T(1), T(0)); template vec_t const vec_t::axis_w = vec_t(T(0), T(0), T(0), T(1)); -#if !LOL_FEATURE_CXX11_CONSTEXPR -#undef constexpr -#endif - } /* namespace lol */ diff --git a/src/t/base/types.cpp b/src/t/base/types.cpp index 7dcf58fc..9cab9324 100644 --- a/src/t/base/types.cpp +++ b/src/t/base/types.cpp @@ -1,7 +1,7 @@ // // Lol Engine — Unit tests // -// Copyright © 2010—2015 Sam Hocevar +// Copyright © 2010—2019 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -23,7 +23,6 @@ lolunit_declare_fixture(build_features) { lolunit_assert_equal(sizeof(half), 2); -#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS lolunit_assert_equal(sizeof(f16vec2), 4); lolunit_assert_equal(sizeof(f16vec3), 6); lolunit_assert_equal(sizeof(f16vec4), 8); @@ -31,7 +30,6 @@ lolunit_declare_fixture(build_features) lolunit_assert_equal(sizeof(f16mat2), 8); lolunit_assert_equal(sizeof(f16mat3), 18); lolunit_assert_equal(sizeof(f16mat4), 32); -#endif } lolunit_declare_test(float_type_sizes) diff --git a/src/t/math/vector.cpp b/src/t/math/vector.cpp index 5c88c8ef..7f04482b 100644 --- a/src/t/math/vector.cpp +++ b/src/t/math/vector.cpp @@ -1,7 +1,7 @@ // // Lol Engine — Unit tests // -// Copyright © 2010—2015 Sam Hocevar +// Copyright © 2010—2019 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -268,7 +268,6 @@ lolunit_declare_fixture(vector_test) lolunit_assert(va == vb); } -#if !LOL_FEATURE_VISUAL_STUDIO_THAT_FUCKING_PIECE_OF_SHIT_COMPILER lolunit_declare_test(vector_iterator) { vec4 v4(1.125f, 1.25f, 1.375f, 1.25f); @@ -304,7 +303,6 @@ lolunit_declare_fixture(vector_test) lolunit_assert_less(x, 1.5f); } } -#endif }; } /* namespace lol */