emacs-diffs
[Top][All Lists]
Advanced

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

master 782ff2f826e: * nt/cmdproxy.c (_snprintf) [_UCRT]: Redirect to 'sn


From: Eli Zaretskii
Subject: master 782ff2f826e: * nt/cmdproxy.c (_snprintf) [_UCRT]: Redirect to 'snprintf'.
Date: Sun, 25 Feb 2024 01:21:43 -0500 (EST)

branch: master
commit 782ff2f826e2fde75f6491f3a6cf0d7fcd5510b2
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    * nt/cmdproxy.c (_snprintf) [_UCRT]: Redirect to 'snprintf'.
---
 nt/cmdproxy.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c
index 0500b653bb2..c012151cf96 100644
--- a/nt/cmdproxy.c
+++ b/nt/cmdproxy.c
@@ -38,6 +38,14 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include <string.h>  /* strlen */
 #include <ctype.h>   /* isspace, isalpha */
 
+/* UCRT has a C99-compatible snprintf, and _snprintf is defined inline
+   in stdio.h, which we don't want to include here.  Since the
+   differences in behavior between snprintf and _snprintf don't matter
+   in this file, we take the easy way out.  */
+#ifdef _UCRT
+# define _snprintf snprintf
+#endif
+
 /* We don't want to include stdio.h because we are already duplicating
    lots of it here */
 extern int _snprintf (char *buffer, size_t count, const char *format, ...);



reply via email to

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