summaryrefslogtreecommitdiffstats
path: root/m4/attribute.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:22:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:22:51 +0000
commit9ada0093e92388590c7368600ca4e9e3e376f0d0 (patch)
treea56fe41110023676d7082028cbaa47ca4b6e6164 /m4/attribute.m4
parentInitial commit. (diff)
downloadpam-upstream.tar.xz
pam-upstream.zip
Adding upstream version 1.5.2.upstream/1.5.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/attribute.m4')
-rw-r--r--m4/attribute.m416
1 files changed, 16 insertions, 0 deletions
diff --git a/m4/attribute.m4 b/m4/attribute.m4
new file mode 100644
index 0000000..3aa2e5f
--- /dev/null
+++ b/m4/attribute.m4
@@ -0,0 +1,16 @@
+#!/usr/bin/m4
+dnl Check for compiler attributes
+
+AC_DEFUN([PAM_ATTRIBUTE_UNUSED], [
+ AC_CACHE_CHECK([for __attribute__((unused))], [pam_cv_attribute_unused],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[int fun(int i __attribute__((unused)));]],
+ [[return fun(0);]])],
+ [pam_cv_attribute_unused=yes],
+ [pam_cv_attribute_unused=no])])
+ AS_IF([test "$pam_cv_attribute_unused" = yes],
+ [unused='__attribute__((unused))'],
+ [unused=])
+ AC_DEFINE_UNQUOTED([UNUSED], [$unused],
+ [Define if the compiler supports __attribute__((unused))])
+])