From fabeecd5ea8446866bf43b7c4c1ff2cf4ad0dc44 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 23 Aug 2012 12:14:07 +0000 Subject: [PATCH] Eo: Fixed issue with eo_add ops. This "fix" is actually just making sure gcc doesn't optimise things wrong. If anyone has an idea how to do it better, please let me know. klass is usually a function and needs to be evaluated before the call to eo_add_internal. SVN revision: 75623 --- legacy/eobj/src/lib/Eo.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy/eobj/src/lib/Eo.h b/legacy/eobj/src/lib/Eo.h index b6e10f3c36..f2a425b0f5 100644 --- a/legacy/eobj/src/lib/Eo.h +++ b/legacy/eobj/src/lib/Eo.h @@ -562,8 +562,8 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); */ #define eo_add(klass, parent, ...) \ ({ \ - (void) klass; \ - eo_add_internal(klass, parent, eo_constructor(), ## __VA_ARGS__, EO_NOOP); \ + volatile const Eo_Class *_tmp_klass = klass; \ + eo_add_internal((const Eo_Class *) _tmp_klass, parent, eo_constructor(), ## __VA_ARGS__, EO_NOOP); \ }) /** @@ -576,8 +576,8 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); */ #define eo_add_custom(klass, parent, ...) \ ({ \ - (void) klass; \ - eo_add_internal(klass, parent, ## __VA_ARGS__, EO_NOOP); \ + volatile const Eo_Class *_tmp_klass = klass; \ + eo_add_internal((const Eo_Class *) _tmp_klass, parent, ## __VA_ARGS__, EO_NOOP); \ }) /**