From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: improve conflict resolution between Gnulib and GNU gettext
Date: Sun, 20 Jun 2021 03:25:36 +0200 [thread overview]
Message-ID: <3284270.rhaEBvZlVd@omega> (raw)
[-- Attachment #1: Type: text/plain, Size: 758 bytes --]
When GNU libintl.h defines a *printf symbol and Gnulib's stdio.h does it as
well, it is best that libintl.h avoids overriding Gnulib. To this effect,
Gnulib needs to set a macro that tells that it has provided an override.
Similarly for textstyle.h (from GNU libtextstyle).
2021-06-19 Bruno Haible <bruno@clisp.org>
unistd: Improve conflict resolution between gnulib and textstyle.h.
* lib/unistd.in.h (GNULIB_overrides_isatty): New macro.
2021-06-19 Bruno Haible <bruno@clisp.org>
stdio: Improve conflict resolution between gnulib and libintl.h.
* lib/stdio.in.h (GNULIB_overrides_snprintf, GNULIB_overrides_sprintf,
GNULIB_overrides_asprintf, GNULIB_overrides_vasprintf,
GNULIB_overrides_vsnprintf, GNULIB_overrides_vsprintf): New macros.
[-- Attachment #2: 0001-stdio-Improve-conflict-resolution-between-gnulib-and.patch --]
[-- Type: text/x-patch, Size: 3415 bytes --]
From 7f7c3c1efc640059f2ad3046353935a2b30aaa06 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sun, 20 Jun 2021 03:23:41 +0200
Subject: [PATCH 1/2] stdio: Improve conflict resolution between gnulib and
libintl.h.
* lib/stdio.in.h (GNULIB_overrides_snprintf, GNULIB_overrides_sprintf,
GNULIB_overrides_asprintf, GNULIB_overrides_vasprintf,
GNULIB_overrides_vsnprintf, GNULIB_overrides_vsprintf): New macros.
---
ChangeLog | 7 +++++++
lib/stdio.in.h | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 11a75d6..188bdaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2021-06-19 Bruno Haible <bruno@clisp.org>
+ stdio: Improve conflict resolution between gnulib and libintl.h.
+ * lib/stdio.in.h (GNULIB_overrides_snprintf, GNULIB_overrides_sprintf,
+ GNULIB_overrides_asprintf, GNULIB_overrides_vasprintf,
+ GNULIB_overrides_vsnprintf, GNULIB_overrides_vsprintf): New macros.
+
+2021-06-19 Bruno Haible <bruno@clisp.org>
+
declared.sh: Allow parsing 'extern "C"' lines.
* build-aux/declared.sh: Don't concatenate lines to an 'extern "C" {'
line.
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index f0f880a..20ba488 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -1257,6 +1257,7 @@ _GL_CXXALIASWARN (scanf);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define snprintf rpl_snprintf
# endif
+# define GNULIB_overrides_snprintf 1
_GL_FUNCDECL_RPL (snprintf, int,
(char *restrict str, size_t size,
const char *restrict format, ...)
@@ -1302,6 +1303,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define sprintf rpl_sprintf
# endif
+# define GNULIB_overrides_sprintf 1
_GL_FUNCDECL_RPL (sprintf, int,
(char *restrict str, const char *restrict format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
@@ -1369,6 +1371,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define asprintf rpl_asprintf
# endif
+# define GNULIB_overrides_asprintf
_GL_FUNCDECL_RPL (asprintf, int,
(char **result, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
@@ -1390,6 +1393,7 @@ _GL_CXXALIASWARN (asprintf);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vasprintf rpl_vasprintf
# endif
+# define GNULIB_overrides_vasprintf 1
_GL_FUNCDECL_RPL (vasprintf, int,
(char **result, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
@@ -1573,6 +1577,7 @@ _GL_CXXALIASWARN (vscanf);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vsnprintf rpl_vsnprintf
# endif
+# define GNULIB_overrides_vsnprintf 1
_GL_FUNCDECL_RPL (vsnprintf, int,
(char *restrict str, size_t size,
const char *restrict format, va_list args)
@@ -1609,6 +1614,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vsprintf rpl_vsprintf
# endif
+# define GNULIB_overrides_vsprintf 1
_GL_FUNCDECL_RPL (vsprintf, int,
(char *restrict str,
const char *restrict format, va_list args)
--
2.7.4
[-- Attachment #3: 0002-unistd-Improve-conflict-resolution-between-gnulib-an.patch --]
[-- Type: text/x-patch, Size: 1359 bytes --]
From fa7147fdd9f2a6112b5256b034ddfed9b29d8b0f Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sun, 20 Jun 2021 03:23:45 +0200
Subject: [PATCH 2/2] unistd: Improve conflict resolution between gnulib and
textstyle.h.
* lib/unistd.in.h (GNULIB_overrides_isatty): New macro.
---
ChangeLog | 5 +++++
lib/unistd.in.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 188bdaf..da5b631 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2021-06-19 Bruno Haible <bruno@clisp.org>
+ unistd: Improve conflict resolution between gnulib and textstyle.h.
+ * lib/unistd.in.h (GNULIB_overrides_isatty): New macro.
+
+2021-06-19 Bruno Haible <bruno@clisp.org>
+
stdio: Improve conflict resolution between gnulib and libintl.h.
* lib/stdio.in.h (GNULIB_overrides_snprintf, GNULIB_overrides_sprintf,
GNULIB_overrides_asprintf, GNULIB_overrides_vasprintf,
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 35abbde..d4d4ba7 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -1521,6 +1521,7 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - "
# undef isatty
# define isatty rpl_isatty
# endif
+# define GNULIB_defined_isatty 1
_GL_FUNCDECL_RPL (isatty, int, (int fd));
_GL_CXXALIAS_RPL (isatty, int, (int fd));
# elif defined _WIN32 && !defined __CYGWIN__
--
2.7.4
reply other threads:[~2021-06-20 1:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3284270.rhaEBvZlVd@omega \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).