aboutsummaryrefslogtreecommitdiff
path: root/libpam/include/pam_cc_compat.h
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-03-16 21:02:18 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-03-19 18:40:16 +0000
commita8b4dce7b53d73de372e150028c970ee0a2a2e97 (patch)
treeff1f409cc316701b981f8dadd3ddb14866c92b8b /libpam/include/pam_cc_compat.h
parent9db69633449a4829d971e8aded348c5c3e9dda64 (diff)
downloadpam-a8b4dce7b53d73de372e150028c970ee0a2a2e97.tar.gz
pam-a8b4dce7b53d73de372e150028c970ee0a2a2e97.tar.bz2
pam-a8b4dce7b53d73de372e150028c970ee0a2a2e97.zip
Introduce pam_inline.h
Introduce a new internal header file for definitions of handly inline functions and macros providing some convenient functionality to libpam and its modules. * libpam/include/pam_cc_compat.h (PAM_SAME_TYPE): New macro. * libpam/include/pam_inline.h: New file. * libpam/Makefile.am (noinst_HEADERS): Add include/pam_inline.h.
Diffstat (limited to 'libpam/include/pam_cc_compat.h')
-rw-r--r--libpam/include/pam_cc_compat.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpam/include/pam_cc_compat.h b/libpam/include/pam_cc_compat.h
index c43989f7..69190368 100644
--- a/libpam/include/pam_cc_compat.h
+++ b/libpam/include/pam_cc_compat.h
@@ -50,4 +50,17 @@
# define DIAG_POP_IGNORE_CAST_ALIGN /* empty */
#endif
+/*
+ * Evaluates to
+ * 1, if the given two types are known to be the same
+ * 0, otherwise.
+ */
+#if PAM_GNUC_PREREQ(3, 0)
+# define PAM_IS_SAME_TYPE(x_, y_) \
+ __builtin_types_compatible_p(__typeof__(x_), __typeof__(y_))
+#else
+/* Cannot tell whether these types are the same. */
+# define PAM_IS_SAME_TYPE(x_, y_) 0
+#endif
+
#endif /* PAM_CC_COMPAT_H */