diff options
author | Tom Hacohen <tom@stosb.com> | 2016-03-11 12:24:11 +0000 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2016-03-11 12:29:04 +0000 |
commit | 8a56f5c98e04bdb945cc9ef82d24d0bf9c52f62c (patch) | |
tree | 19a8410945ed3422aa089c4f1001695100605ea6 | |
parent | 66b4290d917caa3fe8726d345cbde7a17611c257 (diff) | |
download | efl-8a56f5c98e04bdb945cc9ef82d24d0bf9c52f62c.tar.gz |
Revert "Eo: Change to the Eo4 eo_add syntax."
I found a way to keep eo_add() the way it was and gracefully degrade to
a portable (but not as fast) solution for compilers that don't support
the compound macros returning a value gnu extension: ({int a; a;}).
I'm reverting these changes now, and I'll introduce the fallback as soon
as I can.
This reverts commit b85bb3718389470bfc78c079dd5e06def5e963f3.
-rw-r--r-- | src/lib/eo/Eo.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index a6e4f960cd..387f187714 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -610,12 +610,12 @@ EAPI Eo *eo_super(const Eo *obj, const Eo_Class *cur_klass); */ EAPI const Eo_Class *eo_class_get(const Eo *obj); -#define _eo_add_common(objp, klass, parent, is_ref, ...) \ - ((Eo *) ( \ - *objp = _eo_add_internal_start(__FILE__, __LINE__, klass, parent, is_ref), \ - ##__VA_ARGS__, \ - *objp = _eo_add_end(*objp) \ - )) +#define _eo_add_common(klass, parent, is_ref, ...) \ + ({ \ + Eo * const eoid = _eo_add_internal_start(__FILE__, __LINE__, klass, parent, is_ref); \ + __VA_ARGS__; \ + (Eo *) _eo_add_end(eoid); \ + }) /** * @def eo_add @@ -631,13 +631,12 @@ EAPI const Eo_Class *eo_class_get(const Eo *obj); * * If you want a more "consistent" behaviour, take a look at #eo_add_ref. * - * @param objp a pointer to the object id (Eo **) * @param klass the class of the object to create. * @param parent the parent to set to the object. * @param ... The ops to run. * @return An handle to the new object on success, NULL otherwise. */ -#define eo_add(objp, klass, parent, ...) _eo_add_common(objp, klass, parent, EINA_FALSE, ##__VA_ARGS__) +#define eo_add(klass, parent, ...) _eo_add_common(klass, parent, EINA_FALSE, ##__VA_ARGS__) /** * @def eo_add_ref @@ -649,13 +648,12 @@ EAPI const Eo_Class *eo_class_get(const Eo *obj); * when the parent object is deleted until you manually remove the ref * by calling eo_unref(). * - * @param objp a pointer to the object id (Eo **) * @param klass the class of the object to create. * @param parent the parent to set to the object. * @param ... The ops to run. * @return An handle to the new object on success, NULL otherwise. */ -#define eo_add_ref(objp, klass, parent, ...) _eo_add_common(objp, klass, parent, EINA_TRUE, ##__VA_ARGS__) +#define eo_add_ref(klass, parent, ...) _eo_add_common(klass, parent, EINA_TRUE, ##__VA_ARGS__) EAPI Eo * _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent, Eina_Bool ref); |