bug-libunistring
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-libunistring] [PATCH] Restore cdefs.h header


From: Dmitry Baryshkov
Subject: [bug-libunistring] [PATCH] Restore cdefs.h header
Date: Wed, 6 May 2020 03:08:07 +0300

Current gnulib has replaced self-contained unused-parameter.h header
with the snippet that depends on config.h contents. Using this snippet
as is breaks users of Unistring, because resulting cdefs.h becomes
unusable. Restore cdefs.h using

Signed-off-by: Dmitry Baryshkov <address@hidden>
---
 lib/Makefile.am                       | 13 +------------
 lib/unistring/{cdefs.in.h => cdefs.h} | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 13 deletions(-)
 rename lib/unistring/{cdefs.in.h => cdefs.h} (67%)

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 3798a0a9ec59..6136cedbfb3e 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -163,18 +163,7 @@ CLEANFILES       += unistring/iconveh.h
 nobase_nodist_include_HEADERS += unistring/version.h
 
 # unistring/cdefs.h is not public, but is included by other header files.
-nobase_nodist_include_HEADERS += unistring/cdefs.h
-unistring/cdefs.h : unistring/cdefs.in.h $(UNUSED_PARAMETER_H)
-       @MKDIR_P@ unistring
-       rm -f $@-t $@
-       sed -e '/definition of _GL_UNUSED_PARAMETER/r $(UNUSED_PARAMETER_H)' \
-           < $(srcdir)/unistring/cdefs.in.h \
-           > $@-t
-       mv $@-t $@
-BUILT_SOURCES    += unistring/cdefs.h
-MOSTLYCLEANFILES += unistring/cdefs.h-t
-CLEANFILES       += unistring/cdefs.h
-EXTRA_DIST       += unistring/cdefs.in.h
+nobase_include_HEADERS += unistring/cdefs.h
 
 # unistring/woe32dll.h is not public, but is included by other header files.
 nobase_nodist_include_HEADERS += unistring/woe32dll.h
diff --git a/lib/unistring/cdefs.in.h b/lib/unistring/cdefs.h
similarity index 67%
rename from lib/unistring/cdefs.in.h
rename to lib/unistring/cdefs.h
index 838f8c1e9777..b1e65b467424 100644
--- a/lib/unistring/cdefs.in.h
+++ b/lib/unistring/cdefs.h
@@ -17,6 +17,18 @@
 #ifndef _UNISTRING_CDEFS_H
 #define _UNISTRING_CDEFS_H
 
-/* The definition of _GL_UNUSED_PARAMETER is copied here.  */
+#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+#elif _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_ATTRIBUTE_MAYBE_UNUSED
+#endif
+#endif /* !_GL_ATTRIBUTE_MAYBE_UNUSED */
+
+#ifndef _GL_UNUSED_PARAMETER
+# define _GL_UNUSED_PARAMETER _GL_ATTRIBUTE_MAYBE_UNUSED
+#endif
 
 #endif /* _UNISTRING_CDEFS_H */
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]