Skip to content

fix g++ warnings and always_inline usage #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -387,6 +388,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)
Expand Down Expand Up @@ -468,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
Expand Down