From 49d1c7ca21ef141ecab7b104349959490dd2ff77 Mon Sep 17 00:00:00 2001 From: Joshua Henderson Date: Wed, 20 Mar 2019 08:49:01 -0700 Subject: [PATCH 1/3] fix gcc compiler warning with lay_last_child not previously defined Signed-off-by: Joshua Henderson --- layout.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layout.h b/layout.h index 1858a37..aa14374 100644 --- a/layout.h +++ b/layout.h @@ -387,6 +387,8 @@ LAY_STATIC_INLINE lay_id lay_first_child(const lay_context *ctx, lay_id id) return pitem->first_child; } +LAY_EXPORT lay_id lay_last_child(const lay_context *ctx, lay_id parent); + // Get the id of the next sibling of an item, if any. Returns LAY_INVALID_ID if // there is no next sibling. LAY_STATIC_INLINE lay_id lay_next_sibling(const lay_context *ctx, lay_id id) From 2cff2c27b71fcac93ba654605c8598640d4c5b1c Mon Sep 17 00:00:00 2001 From: Joshua Henderson Date: Mon, 25 Mar 2019 08:34:14 -0700 Subject: [PATCH 2/3] fix gcc c++ pedantic warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit layout.h: In function ‘lay_vec4 lay_vec4_xyzw(lay_scalar, lay_scalar, lay_scalar, lay_scalar)’: layout.h:231:33: warning: ISO C++ forbids compound-literals [-Wpedantic] return (lay_vec4){x, y, z, w}; Signed-off-by: Joshua Henderson --- layout.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layout.h b/layout.h index aa14374..385c35d 100644 --- a/layout.h +++ b/layout.h @@ -227,7 +227,8 @@ enum { LAY_STATIC_INLINE lay_vec4 lay_vec4_xyzw(lay_scalar x, lay_scalar y, lay_scalar z, lay_scalar w) { #if defined(__GNUC__) || defined(__clang__) - return (lay_vec4){x, y, z, w}; + lay_vec4 result{x, y, z, w}; + return result; #elif defined(_MSC_VER) lay_vec4 result; result[0] = x; From 7c377424905cc29d719b7d30b95df2a4d3d326d8 Mon Sep 17 00:00:00 2001 From: Joshua Henderson Date: Wed, 26 Jun 2019 16:06:35 -0700 Subject: [PATCH 3/3] gcc always_inline attribute misbehaves on ARM9 On ARM9, telling gcc to always inline with the gcc attribute is causing some random behavior with layout. Just defaulting to the normal inline keyword seems to be fine. Signed-off-by: Joshua Henderson --- layout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout.h b/layout.h index 385c35d..67dfc38 100644 --- a/layout.h +++ b/layout.h @@ -471,7 +471,7 @@ LAY_STATIC_INLINE void lay_get_rect_xywh( #endif #if defined(__GNUC__) || defined(__clang__) -#define LAY_FORCE_INLINE __attribute__((always_inline)) inline +#define LAY_FORCE_INLINE inline #ifdef __cplusplus #define LAY_RESTRICT __restrict #else