diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-07-31 18:06:25 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-07-31 18:09:43 +0800 |
commit | 902f00584b5056ed748785e59715cd3fb00bd224 (patch) | |
tree | fdcff6cfc694fd431f7b7dd4bfab6207bcf88fd8 | |
parent | 554954d1264742bcb735f9100e89d24f5daee958 (diff) | |
download | gtk+-gskglrenderer-avoid-gccism.tar.gz |
gskglrenderer.c: Avoid GCCismgskglrenderer-avoid-gccism
Don't unconditionally use __attribute__((always_inline)), but define a
macro that achieves this for GCC/CLang and Visual Studio.
-rw-r--r-- | gsk/gl/gskglrenderer.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index e2e5d85320..438901f0ca 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -47,6 +47,12 @@ #define OP_PRINT(format, ...) #endif +#if defined (__GNUC__) || defined (__clang__) +# define ALWAYS_INLINE __attribute__((always_inline)) +#elif defined (_MSC_VER) +# define ALWAYS_INLINE __forceinline +#endif + #define INIT_PROGRAM_UNIFORM_LOCATION(program_name, uniform_basename) \ G_STMT_START{\ programs->program_name ## _program.program_name.uniform_basename ## _location = \ @@ -191,7 +197,7 @@ dump_node (GskRenderNode *node, cairo_surface_destroy (surface); } -static inline bool G_GNUC_PURE __attribute__((always_inline)) +static inline bool G_GNUC_PURE ALWAYS_INLINE node_is_invisible (const GskRenderNode *node) { return node->bounds.size.width == 0.0f || @@ -200,7 +206,7 @@ node_is_invisible (const GskRenderNode *node) isnan (node->bounds.size.height); } -static inline bool G_GNUC_PURE __attribute__((always_inline)) +static inline bool G_GNUC_PURE ALWAYS_INLINE graphene_rect_intersects (const graphene_rect_t *r1, const graphene_rect_t *r2) { @@ -216,7 +222,7 @@ graphene_rect_intersects (const graphene_rect_t *r1, return true; } -static inline bool G_GNUC_PURE __attribute__((always_inline)) +static inline bool G_GNUC_PURE ALWAYS_INLINE _graphene_rect_contains_rect (const graphene_rect_t *r1, const graphene_rect_t *r2) { |