]> git.eshelyaron.com Git - emacs.git/commitdiff
* nt/cmdproxy.c (_snprintf) [_UCRT]: Redirect to 'snprintf'.
authorEli Zaretskii <eliz@gnu.org>
Sun, 25 Feb 2024 06:20:44 +0000 (08:20 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 28 Feb 2024 17:52:25 +0000 (18:52 +0100)
(cherry picked from commit 782ff2f826e2fde75f6491f3a6cf0d7fcd5510b2)

nt/cmdproxy.c

index 0500b653bb2ccd475e3220104e4cec5ef59f8e5d..c012151cf9658e632644c18d850999c93d062327 100644 (file)
@@ -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, ...);