* Remove the use of HAVE___ATTRIBUTE__ (which is defined at
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 25 Jun 2009 19:58:05 +0000 (19:58 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 25 Jun 2009 19:58:05 +0000 (19:58 +0000)
   configure time) in an exported header. Use only macros
   defined by the compilers, which is sufficient and simpler.
 * Add missing EINA_DEPRECATED in some cases.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@41199 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/include/eina_types.h

index d34fe47..6592991 100644 (file)
@@ -65,6 +65,9 @@
 #ifdef EINA_ARG_NONNULL
 # undef EINA_ARG_NONNULL
 #endif
+#ifdef EINA_DEPRECATED
+# undef EINA_DEPRECATED
+#endif
 #ifdef EINA_MALLOC
 # undef EINA_MALLOC
 #endif
 # undef EINA_LIKELY
 #endif
 
-#ifdef HAVE___ATTRIBUTE__
-# ifdef __GNUC__
-#  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#   define EINA_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
-#  else
-#   define EINA_WARN_UNUSED_RESULT
-#  endif
 
-#  if (!defined(EINA_SAFETY_CHECKS)) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
-#   define EINA_ARG_NONNULL(idx, ...) __attribute__ ((nonnull(idx, ## __VA_ARGS__)))
-#  else
-#   define EINA_ARG_NONNULL(idx, ...)
-#  endif
+#ifdef __GNUC__
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  define EINA_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
+# else
+#  define EINA_WARN_UNUSED_RESULT
+# endif
 
-#  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-#   define EINA_DEPRECATED __attribute__ ((__deprecated__))
-#  else
-#   define EINA_DEPRECATED
-#  endif
+# if (!defined(EINA_SAFETY_CHECKS)) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
+#  define EINA_ARG_NONNULL(idx, ...) __attribute__ ((nonnull(idx, ## __VA_ARGS__)))
+# else
+#  define EINA_ARG_NONNULL(idx, ...)
+# endif
 
-#  if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-#   define EINA_MALLOC __attribute__ ((malloc))
-#   define EINA_PURE __attribute__ ((pure))
-#  else
-#   define EINA_MALLOC
-#   define EINA_PURE
-#  endif
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#  define EINA_DEPRECATED __attribute__ ((__deprecated__))
+# else
+#  define EINA_DEPRECATED
+# endif
 
-#  if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
-#   define EINA_PRINTF(fmt, arg)  __attribute__((format (printf, fmt, arg)))
-#   define EINA_SCANF(fmt, arg)  __attribute__((format (scanf, fmt, arg)))
-#   define EINA_FORMAT(fmt) __attribute__((format_arg(fmt)))
-#   define EINA_CONST __attribute__((const))
-#   define EINA_UNLIKELY(exp) __builtin_expect((exp), 0)
-#   define EINA_LIKELY(exp) __builtin_expect((exp), 1)
-#  else
-#   define EINA_PRINTF(fmt, arg)
-#   define EINA_SCANF(fmt, arg)
-#   define EINA_FORMAT(fmt)
-#   define EINA_CONST
-#   define EINA_UNLIKELY(exp) exp
-#   define EINA_LIKELY(exp) exp
-#  endif
-# else /* no __GNUC__ */
-#  define EINA_WARN_UNUSED_RESULT
-#  define EINA_ARG_NONNULL(idx, ...)
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+#  define EINA_MALLOC __attribute__ ((malloc))
+#  define EINA_PURE __attribute__ ((pure))
+# else
 #  define EINA_MALLOC
 #  define EINA_PURE
+# endif
+
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#  define EINA_PRINTF(fmt, arg)  __attribute__((format (printf, fmt, arg)))
+#  define EINA_SCANF(fmt, arg)  __attribute__((format (scanf, fmt, arg)))
+#  define EINA_FORMAT(fmt) __attribute__((format_arg(fmt)))
+#  define EINA_CONST __attribute__((const))
+#  define EINA_UNLIKELY(exp) __builtin_expect((exp), 0)
+#  define EINA_LIKELY(exp) __builtin_expect((exp), 1)
+# else
 #  define EINA_PRINTF(fmt, arg)
 #  define EINA_SCANF(fmt, arg)
 #  define EINA_FORMAT(fmt)
 #  define EINA_UNLIKELY(exp) exp
 #  define EINA_LIKELY(exp) exp
 # endif
+
 #elif defined(_WIN32)
 # define EINA_WARN_UNUSED_RESULT
 # define EINA_ARG_NONNULL(idx, ...)
 # define EINA_CONST
 # define EINA_UNLIKELY(exp) exp
 # define EINA_LIKELY(exp) exp
-#else /* no HAVE___ATTRIBUTE__ */
+
+#else /* ! __GNUC__ && ! _WIN32 */
 # define EINA_WARN_UNUSED_RESULT
 # define EINA_ARG_NONNULL(idx, ...)
 # define EINA_DEPRECATED
 # define EINA_CONST
 # define EINA_UNLIKELY(exp) exp
 # define EINA_LIKELY(exp) exp
-#endif
+#endif /* ! __GNUC__ && ! _WIN32 */
 
 
 /* remove this TRUE/FALSE redifinitions */