Blame SOURCES/pam-1.3.1-pam-cc-compat.patch

c55e18
diff -up Linux-PAM-1.3.1/libpam/include/pam_cc_compat.h.pam-cc-compat Linux-PAM-1.3.1/libpam/include/pam_cc_compat.h
c55e18
--- Linux-PAM-1.3.1/libpam/include/pam_cc_compat.h.pam-cc-compat	2022-05-26 10:43:50.436328027 +0200
c55e18
+++ Linux-PAM-1.3.1/libpam/include/pam_cc_compat.h	2022-05-26 10:43:50.436328027 +0200
c55e18
@@ -0,0 +1,47 @@
c55e18
+/*
c55e18
+ * Copyright (c) 2020 Dmitry V. Levin <ldv@altlinux.org>
c55e18
+ */
c55e18
+
c55e18
+#ifndef PAM_CC_COMPAT_H
c55e18
+#define PAM_CC_COMPAT_H
c55e18
+
c55e18
+#include "config.h"
c55e18
+#include <security/_pam_types.h>
c55e18
+
c55e18
+#if defined __clang__ && defined __clang_major__ && defined __clang_minor__
c55e18
+# define PAM_CLANG_PREREQ(maj, min)					\
c55e18
+	((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
c55e18
+#else
c55e18
+# define PAM_CLANG_PREREQ(maj, min)	0
c55e18
+#endif
c55e18
+
c55e18
+#if PAM_GNUC_PREREQ(4, 6)
c55e18
+# define DIAG_PUSH_IGNORE_CAST_QUAL					\
c55e18
+	_Pragma("GCC diagnostic push");					\
c55e18
+	_Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
c55e18
+# define DIAG_POP_IGNORE_CAST_QUAL					\
c55e18
+	_Pragma("GCC diagnostic pop")
c55e18
+# define DIAG_PUSH_IGNORE_CAST_ALIGN					\
c55e18
+	_Pragma("GCC diagnostic push");					\
c55e18
+	_Pragma("GCC diagnostic ignored \"-Wcast-align\"")
c55e18
+# define DIAG_POP_IGNORE_CAST_ALIGN					\
c55e18
+	_Pragma("GCC diagnostic pop")
c55e18
+#elif PAM_CLANG_PREREQ(2, 6)
c55e18
+# define DIAG_PUSH_IGNORE_CAST_QUAL					\
c55e18
+	_Pragma("clang diagnostic push");				\
c55e18
+	_Pragma("clang diagnostic ignored \"-Wcast-qual\"")
c55e18
+# define DIAG_POP_IGNORE_CAST_QUAL					\
c55e18
+	_Pragma("clang diagnostic pop")
c55e18
+# define DIAG_PUSH_IGNORE_CAST_ALIGN					\
c55e18
+	_Pragma("clang diagnostic push");				\
c55e18
+	_Pragma("clang diagnostic ignored \"-Wcast-align\"")
c55e18
+# define DIAG_POP_IGNORE_CAST_ALIGN					\
c55e18
+	_Pragma("clang diagnostic pop")
c55e18
+#else
c55e18
+# define DIAG_PUSH_IGNORE_CAST_QUAL	/* empty */
c55e18
+# define DIAG_POP_IGNORE_CAST_QUAL	/* empty */
c55e18
+# define DIAG_PUSH_IGNORE_CAST_ALIGN	/* empty */
c55e18
+# define DIAG_POP_IGNORE_CAST_ALIGN	/* empty */
c55e18
+#endif
c55e18
+
c55e18
+#endif /* PAM_CC_COMPAT_H */
c55e18
diff -up Linux-PAM-1.3.1/libpam/Makefile.am.pam-cc-compat Linux-PAM-1.3.1/libpam/Makefile.am
c55e18
--- Linux-PAM-1.3.1/libpam/Makefile.am.pam-cc-compat	2022-05-26 10:43:50.436328027 +0200
c55e18
+++ Linux-PAM-1.3.1/libpam/Makefile.am	2022-05-26 10:44:00.865402730 +0200
c55e18
@@ -18,7 +18,7 @@ include_HEADERS = include/security/_pam_
c55e18
 	include/security/pam_ext.h include/security/pam_modutil.h
c55e18
 
c55e18
 noinst_HEADERS = pam_prelude.h pam_private.h pam_tokens.h \
c55e18
-		pam_modutil_private.h
c55e18
+		pam_modutil_private.h include/pam_cc_compat.h
c55e18
 
c55e18
 libpam_la_LDFLAGS = -no-undefined -version-info 84:2:84
c55e18
 libpam_la_LIBADD = @LIBAUDIT@ $(LIBPRELUDE_LIBS) @LIBDL@