Evas: Improve EVAS_OBJECT_LEGACY_API a bit more
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 16 Mar 2016 10:36:19 +0000 (19:36 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 17 Mar 2016 04:10:35 +0000 (13:10 +0900)
This now calls EINA_SAFETY_ERROR which makes it easy to then
break inside _eina_legacy_error.

src/lib/evas/include/evas_private.h

index ceee4a7..48b0b0b 100644 (file)
@@ -579,7 +579,8 @@ MAGIC_CHECK_FAILED(o, t, m)
    do { Evas_Object_Protected_Data *_o = eo_data_scope_get(_eo, EVAS_OBJECT_CLASS); \
       if (EINA_UNLIKELY(!_o)) return __VA_ARGS__; \
       if (EINA_UNLIKELY(!_o->legacy)) { \
-         ERR("Calling legacy function '%s' on EO object '%s' is not permitted!", __FUNCTION__, eo_class_name_get(_o->object)); \
+         char buf[1024]; snprintf(buf, sizeof(buf), "Calling legacy API on EO object '%s' is not permitted!", eo_class_name_get(_o->object)); \
+         EINA_SAFETY_ERROR(buf); \
          return __VA_ARGS__; \
    } } while (0)
 #else
@@ -587,7 +588,8 @@ MAGIC_CHECK_FAILED(o, t, m)
    do { Evas_Object_Protected_Data *_o = eo_data_scope_get(_eo, EVAS_OBJECT_CLASS); \
       if (EINA_UNLIKELY(!_o)) return __VA_ARGS__; \
       if (EINA_UNLIKELY(!_o->legacy)) { \
-         ERR("Calling legacy function '%s' on EO object '%s' is not permitted!", __FUNCTION__, eo_class_name_get(_o->object)); \
+         char buf[1024]; snprintf(buf, sizeof(buf), "Calling legacy API on EO object '%s' is not permitted!", eo_class_name_get(_o->object)); \
+         EINA_SAFETY_ERROR(buf); \
    } } while (0)
 #endif