From 45740e7a248b4b995644646e38d94b8be44fc60c Mon Sep 17 00:00:00 2001 From: Jemma Issroff Date: Wed, 16 Aug 2023 15:42:56 -0700 Subject: [PATCH] [ruby/yarp] Use _snprintf when using Windows versions prior to 2015 (< 1900) Ruby CI has informed us that snprintf is not available on Windows versions, but _sprintf is supported. This commit allows us to use _sprintf where applicable https://github.com/ruby/yarp/commit/818cc96afe --- yarp/defines.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yarp/defines.h b/yarp/defines.h index 32ed3a557a..c08d578422 100644 --- a/yarp/defines.h +++ b/yarp/defines.h @@ -34,6 +34,11 @@ # define inline __inline #endif +// Windows versions before 2015 use _snprintf +#if defined(_MSC_VER) && (_MSC_VER < 1900) +# define snprintf _snprintf +#endif + int yp_strncasecmp(const char *string1, const char *string2, size_t length); #endif