test/efl: use static_cast for actionslider's smart data
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Thu, 1 Aug 2013 19:46:46 +0000 (12:46 -0700)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Thu, 1 Aug 2013 19:55:23 +0000 (12:55 -0700)
The pragma GCC diagnostic doesn't work properly on gcc >= 4.7.1

Seems to be related to this bug:
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55881

Thus, we have to avoid the actionslider macros :-/.

Since Elementary 1.7.x uses a different accessor than 1.8+ to get
to the underlying smart data, added a configure check for the
elementary version (HAVE_ELM_1_7) in order to select which accessor
needs to be used.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
configure.ac
src/test/efl/test_actionslider.cpp

index b48e42c..0f15af5 100644 (file)
@@ -121,6 +121,17 @@ if test "x$want_efl_tests" != "xno"; then
                [
                        AC_DEFINE(HAVE_EFL, 1, [Support for EFL Tests])
                        have_efl="yes"
+                       PKG_CHECK_MODULES([ELM_1_7],
+                               [
+                                       elementary >= 1.7.0
+                                       elementary < 1.7.99
+                               ],
+                               [
+                                       AC_DEFINE(HAVE_ELM_1_7, 1, [Support for ELM 1.7.x])
+                                       have_elm_1_7="yes"
+                               ],
+                               [have_elm_1_7="no"]
+                       )
                ],
                [have_efl="no"]
        )
index c444155..914e77d 100644 (file)
@@ -55,10 +55,13 @@ public:
 
        Geometry getButtonGeometry() const
        {
-#pragma GCC diagnostic ignored "-fpermissive"
-               ELM_ACTIONSLIDER_DATA_GET(*this, sd);
-#pragma GCC diagnostic error "-fpermissive"
-
+               #if defined(HAVE_ELM_1_7)
+               Elm_Actionslider_Smart_Data *sd = static_cast<Elm_Actionslider_Smart_Data*>(
+                       evas_object_smart_data_get(o));
+               #else
+               Elm_Actionslider_Smart_Data *sd = static_cast<Elm_Actionslider_Smart_Data*>(
+                       eo_data_scope_get(*this, ELM_OBJ_ACTIONSLIDER_CLASS));
+               #endif
                EvasObject o(sd->drag_button_base, false);
                return o.getGeometry();
        }