/xbmc/screensavers/rsxs-0.9/m4/restrict.m4

http://github.com/xbmc/xbmc · m4 · 38 lines · 21 code · 2 blank · 15 comment · 0 complexity · 8393e27ec52e794e9f1553d4beacaed0 MD5 · raw file

  1. #serial 1003
  2. dnl Copyright (C) 2003 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. # This macro can be removed once we can rely on Autoconf 2.57a or later,
  7. # since we can then use its AC_C_RESTRICT.
  8. # gl_C_RESTRICT
  9. # --------------
  10. # Determine whether the C/C++ compiler supports the "restrict" keyword
  11. # introduced in ANSI C99, or an equivalent. Do nothing if the compiler
  12. # accepts it. Otherwise, if the compiler supports an equivalent,
  13. # define "restrict" to be that. Here are some variants:
  14. # - GCC supports both __restrict and __restrict__
  15. # - older DEC Alpha C compilers support only __restrict
  16. # - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C
  17. # Otherwise, define "restrict" to be empty.
  18. AC_DEFUN([gl_C_RESTRICT],
  19. [AC_CACHE_CHECK([for C/C++ restrict keyword], gl_cv_c_restrict,
  20. [gl_cv_c_restrict=no
  21. # Try the official restrict keyword, then gcc's __restrict, and
  22. # the less common variants.
  23. for ac_kw in restrict __restrict __restrict__ _Restrict; do
  24. AC_COMPILE_IFELSE([AC_LANG_SOURCE(
  25. [float * $ac_kw x;])],
  26. [gl_cv_c_restrict=$ac_kw; break])
  27. done
  28. ])
  29. case $gl_cv_c_restrict in
  30. restrict) ;;
  31. no) AC_DEFINE(restrict,,
  32. [Define to equivalent of C99 restrict keyword, or to nothing if this
  33. is not supported. Do not define if restrict is supported directly.]) ;;
  34. *) AC_DEFINE_UNQUOTED(restrict, $gl_cv_c_restrict) ;;
  35. esac
  36. ])