Merge pull request #25495 from IronicallySerious/fix-expand-macros

Fix parameterised macros in core. Addresses #25488
This commit is contained in:
Rémi Verschelde 2019-03-16 11:20:52 -07:00 committed by GitHub
commit aff3dd36ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,7 @@
// va_copy, otherwise you have to use the internal version (__va_copy). // va_copy, otherwise you have to use the internal version (__va_copy).
#if !defined(va_copy) #if !defined(va_copy)
#if defined(__GNUC__) #if defined(__GNUC__)
#define va_copy(d, s) __va_copy(d, s) #define va_copy(d, s) __va_copy((d), (s))
#else #else
#define va_copy(d, s) ((d) = (s)) #define va_copy(d, s) ((d) = (s))
#endif #endif

View file

@ -515,7 +515,7 @@ static inline void _build_faces(uint8_t ***p_cell_status, int x, int y, int z, i
Vector3(1,1,1), Vector3(1,1,1),
}; };
*/ */
#define vert(m_idx) Vector3((m_idx & 4) >> 2, (m_idx & 2) >> 1, m_idx & 1) #define vert(m_idx) Vector3(((m_idx)&4) >> 2, ((m_idx)&2) >> 1, (m_idx)&1)
static const uint8_t indices[6][4] = { static const uint8_t indices[6][4] = {
{ 7, 6, 4, 5 }, { 7, 6, 4, 5 },

View file

@ -137,7 +137,7 @@ T *_nullptr() {
/** Generic swap template */ /** Generic swap template */
#ifndef SWAP #ifndef SWAP
#define SWAP(m_x, m_y) __swap_tmpl(m_x, m_y) #define SWAP(m_x, m_y) __swap_tmpl((m_x), (m_y))
template <class T> template <class T>
inline void __swap_tmpl(T &x, T &y) { inline void __swap_tmpl(T &x, T &y) {