Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_forceinline.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_FORCEINLINE()
  8. #
  9. # DESCRIPTION
  10. #
  11. # Provides a test for C compiler support of forced inlining. If usable,
  12. # #define FORCEINLINE to the appropriate force inline keyword. Otherwise
  13. # #define FORCEINLINE to be 'inline'.
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2008 Alan Woodland <ajw05@aber.ac.uk>
  18. # Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
  19. #
  20. # Copying and distribution of this file, with or without modification, are
  21. # permitted in any medium without royalty provided the copyright notice
  22. # and this notice are preserved. This file is offered as-is, without any
  23. # warranty.
  24. #serial 3
  25. AC_DEFUN([AX_FORCEINLINE], [
  26. AC_LANG_PUSH([C])
  27. AC_MSG_CHECKING(for forced inline keyword)
  28. AC_CACHE_VAL(ac_cv_forceinline, [
  29. ax_forceinline_keywords="__forceinline inline none"
  30. for ax_forceinline_keyword in $ax_forceinline_keywords; do
  31. case $ax_forceinline_keyword in
  32. none) ac_cv_forceinline=none ; break ;;
  33. *)
  34. AC_TRY_COMPILE(
  35. [#include <stdlib.h>
  36. ] $ax_forceinline_keyword [
  37. static void
  38. foo(void) {
  39. exit(1);
  40. }],
  41. [],
  42. [ac_cv_forceinline=$ax_forceinline_keyword ; break],
  43. ac_cv_forceinline=none
  44. )
  45. esac
  46. done
  47. ])
  48. if test "$ac_cv_forceinline" = "none"; then
  49. ax_forceinline_keyword=
  50. else
  51. ax_forceinline_keyword=$ac_cv_forceinline
  52. fi
  53. AC_DEFINE_UNQUOTED([FORCEINLINE],$ax_forceinline_keyword,
  54. [The most forceful inline keyword known by the compiler])
  55. AC_MSG_RESULT($ac_cv_forceinline)
  56. AC_LANG_POP([C])
  57. ])