~enlightenment-git/enlightenment-svn/e-modules-extra

« back to all changes in this revision

Viewing changes to everything-wallpaper/m4/ac_attribute.m4

  • Committer: jeffdameth
  • Date: 2010-05-18 06:08:27 UTC
  • Revision ID: svn-v4:7cbeb6ba-43b4-40fd-8cce-4c39aea84d33:trunk/E-MODULES-EXTRA:48960
going to move wallpaper out of e modules. who wants to have it can get it here :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Copyright (C) 2004-2008 Kim Woelders
 
2
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
 
3
dnl That code is public domain and can be freely used or copied.
 
4
dnl Originally snatched from somewhere...
 
5
 
 
6
dnl Macro for checking if the compiler supports __attribute__
 
7
 
 
8
dnl Usage: AC_C___ATTRIBUTE__
 
9
dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
 
10
dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
 
11
dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
 
12
dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
 
13
dnl defined to nothing.
 
14
 
 
15
AC_DEFUN([AC_C___ATTRIBUTE__],
 
16
[
 
17
 
 
18
AC_MSG_CHECKING([for __attribute__])
 
19
 
 
20
AC_CACHE_VAL([ac_cv___attribute__],
 
21
   [AC_TRY_COMPILE(
 
22
       [
 
23
#include <stdlib.h>
 
24
 
 
25
int func(int x);
 
26
int foo(int x __attribute__ ((unused)))
 
27
{
 
28
   exit(1);
 
29
}
 
30
       ],
 
31
       [],
 
32
       [ac_cv___attribute__="yes"],
 
33
       [ac_cv___attribute__="no"]
 
34
    )])
 
35
 
 
36
AC_MSG_RESULT($ac_cv___attribute__)
 
37
 
 
38
if test "x${ac_cv___attribute__}" = "xyes" ; then
 
39
   AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
 
40
   AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
 
41
  else
 
42
    AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
 
43
fi
 
44
 
 
45
])
 
46
 
 
47
dnl End of ac_attribute.m4