Browse Source

build: _C conflicts with other macros (rightly so); fix this.

undefined
Sam Hocevar 9 years ago
parent
commit
868a0502ef
2 changed files with 40 additions and 40 deletions
  1. +33
    -33
      src/lol/base/types.h
  2. +7
    -7
      src/lol/math/geometry.h

+ 33
- 33
src/lol/base/types.h View File

@@ -46,7 +46,7 @@ template<typename T> struct sqt_t;
* Generic GLSL-like type names
*/

#define _T(tleft, tright, suffix) \
#define T_(tleft, tright, suffix) \
typedef tleft half tright f16##suffix; \
typedef tleft float tright suffix; \
typedef tleft double tright d##suffix; \
@@ -62,38 +62,38 @@ template<typename T> struct sqt_t;
typedef tleft real tright r##suffix;

/* Idiotic hack to put "," inside a macro argument */
#define _C ,
_T(vec_t<, _C 2>, vec2)
_T(vec_t<, _C 3>, vec3)
_T(vec_t<, _C 4>, vec4)
_T(vec_t<, _C 5>, vec5)
_T(vec_t<, _C 6>, vec6)
_T(vec_t<, _C 7>, vec7)
_T(vec_t<, _C 8>, vec8)
_T(vec_t<, _C 9>, vec9)
_T(vec_t<, _C 10>, vec10)
_T(vec_t<, _C 11>, vec11)
_T(vec_t<, _C 12>, vec12)
_T(mat_t<, _C 2 _C 2>, mat2)
_T(mat_t<, _C 3 _C 3>, mat3)
_T(mat_t<, _C 4 _C 4>, mat4)
_T(mat_t<, _C 2 _C 3>, mat2x3)
_T(mat_t<, _C 2 _C 4>, mat2x4)
_T(mat_t<, _C 3 _C 2>, mat3x2)
_T(mat_t<, _C 3 _C 4>, mat3x4)
_T(mat_t<, _C 4 _C 2>, mat4x2)
_T(mat_t<, _C 4 _C 3>, mat4x3)
_T(cmplx_t<, >, cmplx)
_T(quat_t<, >, quat)
_T(dualquat_t<, >, dualquat)
_T(sqt_t<, >, sqt)
#undef _C
#undef _T
#define C_ ,
T_(vec_t<, C_ 2>, vec2)
T_(vec_t<, C_ 3>, vec3)
T_(vec_t<, C_ 4>, vec4)
T_(vec_t<, C_ 5>, vec5)
T_(vec_t<, C_ 6>, vec6)
T_(vec_t<, C_ 7>, vec7)
T_(vec_t<, C_ 8>, vec8)
T_(vec_t<, C_ 9>, vec9)
T_(vec_t<, C_ 10>, vec10)
T_(vec_t<, C_ 11>, vec11)
T_(vec_t<, C_ 12>, vec12)
T_(mat_t<, C_ 2 C_ 2>, mat2)
T_(mat_t<, C_ 3 C_ 3>, mat3)
T_(mat_t<, C_ 4 C_ 4>, mat4)
T_(mat_t<, C_ 2 C_ 3>, mat2x3)
T_(mat_t<, C_ 2 C_ 4>, mat2x4)
T_(mat_t<, C_ 3 C_ 2>, mat3x2)
T_(mat_t<, C_ 3 C_ 4>, mat3x4)
T_(mat_t<, C_ 4 C_ 2>, mat4x2)
T_(mat_t<, C_ 4 C_ 3>, mat4x3)
T_(cmplx_t<, >, cmplx)
T_(quat_t<, >, quat)
T_(dualquat_t<, >, dualquat)
T_(sqt_t<, >, sqt)
#undef C_
#undef T_

/*
* HLSL/Cg-compliant type names


+ 7
- 7
src/lol/math/geometry.h View File

@@ -73,21 +73,21 @@ typedef SafeEnum<DirectionBase> Direction;
* Generic box type names
*/

#define _T(tleft, tright, suffix) \
#define T_(tleft, tright, suffix) \
typedef tleft float tright suffix; \
typedef tleft double tright d##suffix; \
typedef tleft int32_t tright i##suffix; \
typedef tleft uint32_t tright u##suffix;

/* Idiotic hack to put "," inside a macro argument */
#define _C ,
#define C_ ,

_T(box_t<, _C 2>, box2)
_T(box_t<, _C 3>, box3)
_T(box_t<, _C 4>, box4)
T_(box_t<, C_ 2>, box2)
T_(box_t<, C_ 3>, box3)
T_(box_t<, C_ 4>, box4)

#undef _C
#undef _T
#undef C_
#undef T_

template<typename T, int N>
struct box_t


Loading…
Cancel
Save