cedric pushed a commit to branch master.

commit fa57dd8b2a36d46ae1e0cc621cd5a8164feb334f
Author: Cedric Bail <[email protected]>
Date:   Mon Jul 29 16:28:07 2013 +0900

    eina: seems like all the compiler we support do support __typeof__.
---
 src/lib/eina/eina_inarray.h | 33 +++++++++------------------------
 src/lib/eina/eina_inlist.h  | 19 ++++---------------
 2 files changed, 13 insertions(+), 39 deletions(-)

diff --git a/src/lib/eina/eina_inarray.h b/src/lib/eina/eina_inarray.h
index 1599f03..ed1a84b 100644
--- a/src/lib/eina/eina_inarray.h
+++ b/src/lib/eina/eina_inarray.h
@@ -685,17 +685,10 @@ EAPI Eina_Accessor *eina_inarray_accessor_new(const 
Eina_Inarray *array) EINA_MA
  *
  * @since 1.2
  */
-#ifdef __GNUC__
-# define EINA_INARRAY_FOREACH(array, itr)                                \
-   for ((itr) = (array)->members;                                      \
-        (itr) < (((__typeof__(*itr)*)(array)->members) + (array)->len);        
\
-        (itr)++)
-#else
-# define EINA_INARRAY_FOREACH(array, itr)                                \
-   for ((itr) = (array)->members;                                      \
-        (itr) < (((typeof(*itr)*)(array)->members) + (array)->len);    \
-        (itr)++)
-#endif
+#define EINA_INARRAY_FOREACH(array, itr)                                \
+  for ((itr) = (array)->members;                                       \
+       (itr) < (((__typeof__(*itr)*)(array)->members) + (array)->len); \
+       (itr)++)
 
 /**
  * @def EINA_INARRAY_REVERSE_FOREACH
@@ -713,19 +706,11 @@ EAPI Eina_Accessor *eina_inarray_accessor_new(const 
Eina_Inarray *array) EINA_MA
  *
  * @since 1.2
  */
-#ifdef __GNUC__
-# define EINA_INARRAY_REVERSE_FOREACH(array, itr)                        \
-   for ((itr) = ((((__typeof__(*(itr))*)(array)->members) + (array)->len) - 
1); \
-        (((itr) >= (__typeof__(*(itr))*)(array)->members)                      
\
-         && ((array)->members != NULL));                                       
\
-        (itr)--)
-#else
-# define EINA_INARRAY_REVERSE_FOREACH(array, itr)                        \
-   for ((itr) = ((((typeof(*(itr))*)(array)->members) + (array)->len) - 1); \
-        (((itr) >= (typeof(*(itr))*)(array)->members)                  \
-         && ((array)->members != NULL));                                       
\
-        (itr)--)
-#endif
+#define EINA_INARRAY_REVERSE_FOREACH(array, itr)                        \
+  for ((itr) = ((((__typeof__(*(itr))*)(array)->members) + (array)->len) - 1); 
\
+       (((itr) >= (__typeof__(*(itr))*)(array)->members)               \
+       && ((array)->members != NULL));                                 \
+       (itr)--)
 
 /**
  * @}
diff --git a/src/lib/eina/eina_inlist.h b/src/lib/eina/eina_inlist.h
index 263d8d7..0cc187e 100644
--- a/src/lib/eina/eina_inlist.h
+++ b/src/lib/eina/eina_inlist.h
@@ -818,13 +818,8 @@ EAPI Eina_Inlist *eina_inlist_sort(Eina_Inlist *head, 
Eina_Compare_Cb func);
  * In C++ we can't assign a "type*" pointer to void* so we rely on GCC's typeof
  * operator.
  */
-# ifdef __GNUC__
-#  define _EINA_INLIST_CONTAINER(ref, ptr) (__typeof__(ref))((char *)(ptr) - \
-                                                  _EINA_INLIST_OFFSET(ref))
-# else
-#  define _EINA_INLIST_CONTAINER(ref, ptr) (typeof(ref))((char *)(ptr) - \
-                                                  _EINA_INLIST_OFFSET(ref))
-# endif
+# define _EINA_INLIST_CONTAINER(ref, ptr) (__typeof__(ref))((char *)(ptr) - \
+                                                           
_EINA_INLIST_OFFSET(ref))
 #endif
 
 /**
@@ -873,14 +868,8 @@ EAPI Eina_Inlist *eina_inlist_sort(Eina_Inlist *head, 
Eina_Compare_Cb func);
  * don't remove all items from the list.
  * @since 1.8
  */
-#ifdef __GNUC__
-# define EINA_INLIST_FREE(list, it)                            \
-   for (it = (__typeof__(it)) list; list; it = (__typeof__(it)) list)
-#else
-# define EINA_INLIST_FREE(list, it)                            \
-   for (it = (typeof(it)) list; list; it = (typeof(it)) list)
-#endif
-
+#define EINA_INLIST_FREE(list, it)                             \
+  for (it = (__typeof__(it)) list; list; it = (__typeof__(it)) list)
 
 #include "eina_inline_inlist.x"
 

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

Reply via email to