2009/4/20 Detlef Riekenberg <[email protected]>:
> On Mo, 2009-04-20 at 10:01 +0200, Henri Verbeet wrote:
>> More specifically, you need to protect this with an #ifdef.
>
>> #ifdef __GNUC__
>> #define __WINE_ATTR_UNUSED __attribute__((unused))
>> #else
>> #define __WINE_ATTR_UNUSED
>> #endif
>
> Support for compiler specific features should be tested during
> configure.

>From http://autoconf-archive.cryp.to/ax_c___attribute__.html:

AC_DEFUN([AX_C___ATTRIBUTE__], [
  AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__],
    [AC_COMPILE_IFELSE(
      [AC_LANG_PROGRAM(
        [[#include <stdlib.h>
          static void foo(void) __attribute__ ((unused));
          static void
          foo(void) {
              exit(1);
          }
        ]], [])],
      [ax_cv___attribute__=yes],
      [ax_cv___attribute__=no]
    )
  ])
  if test "$ax_cv___attribute__" = "yes"; then
    AC_DEFINE([HAVE___ATTRIBUTE__], 1, [define if your compiler has
__attribute__])
  fi
])

then:

#ifdef HAVE___ATTRIBUTE__
#define __WINE_ATTR_UNUSED __attribute__((unused))
#else
#define __WINE_ATTR_UNUSED
#endif


- Reece


Reply via email to