]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Fix for clang -Wstrict-bool clashing with #include <rpc/rpc.h>
authorMarco Bettini <marco.bettini@open-xchange.com>
Mon, 2 May 2022 11:14:10 +0000 (11:14 +0000)
committermartti.rannanjarvi <martti.rannanjarvi@open-xchange.com>
Thu, 19 May 2022 06:25:58 +0000 (06:25 +0000)
src/plugins/quota/Makefile.am
src/plugins/quota/rquota-pragmas.h [new file with mode: 0644]

index e8bad8c41462efcbb864483846e51f7085e9a726..ad08d507ba60881914e1f3e75853a70666de077c 100644 (file)
@@ -84,8 +84,8 @@ quota_status_DEPENDENCIES = \
 if HAVE_RQUOTA
 RQUOTA_XDR = rquota_xdr.c
 RQUOTA_XDR_LO = rquota_xdr.lo
-#RQUOTA_X = /usr/include/rpcsvc/rquota.x
 RQUOTA_X = $(srcdir)/rquota.x
+RQUOTA_PRAGMAS_H = $(srcdir)/rquota-pragmas.h
 rquota_xdr.c: Makefile rquota.h
        if [ "$(top_srcdir)" != "$(top_builddir)" ]; then \
          cp $(RQUOTA_X) $(top_builddir)/src/plugins/quota/; \
@@ -95,14 +95,17 @@ rquota_xdr.c: Makefile rquota.h
         echo '#undef TRUE'; \
         echo '#include <rpc/rpc.h>'; \
         $(RPCGEN) -c $(top_builddir)/src/plugins/quota/rquota.x | \
-         sed -e 's/IXDR_PUT/(void)IXDR_PUT/g' \
+         sed \
+           -e 's/IXDR_PUT/(void)IXDR_PUT/g' \
            -e 's,!xdr_,0 == xdr_,' \
            -e 's,/usr/include/rpcsvc/rquota.h,rquota.h,' \
            -e 's/int32_t \*buf/int32_t *buf ATTR_UNUSED/' \
-           -e 's/^static char rcsid.*//' ) > rquota_xdr.c
+           -e 's/^static char rcsid.*//' ) > rquota_xdr.c.tmp
+       cat $(RQUOTA_PRAGMAS_H) rquota_xdr.c.tmp > rquota_xdr.c
 
 rquota.h: Makefile $(RQUOTA_X)
-       $(RPCGEN) -h $(RQUOTA_X) > rquota.h
+       $(RPCGEN) -h $(RQUOTA_X) > rquota.h.tmp
+       cat $(RQUOTA_PRAGMAS_H) rquota.h.tmp > rquota.h
 
 quota-fs.lo: rquota.h
 
@@ -115,7 +118,8 @@ pkginc_lib_HEADERS = \
        quota-plugin.h \
        quota-private.h
 noinst_HEADERS = \
-       quota-status-settings.h
+       quota-status-settings.h \
+       rquota-pragmas.h
 
 EXTRA_DIST = rquota.x
 
diff --git a/src/plugins/quota/rquota-pragmas.h b/src/plugins/quota/rquota-pragmas.h
new file mode 100644 (file)
index 0000000..3cf2a1f
--- /dev/null
@@ -0,0 +1,4 @@
+#include "config.h"
+#ifdef HAVE_STRICT_BOOL
+#  pragma GCC diagnostic ignored "-Wstrict-bool"
+#endif