aboutsummaryrefslogtreecommitdiffstats
path: root/yarp
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2023-08-16 15:42:56 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2023-08-16 17:47:32 -0700
commit45740e7a248b4b995644646e38d94b8be44fc60c (patch)
tree47b3c41a573ff73ce79a8c55be3c9b157f771c13 /yarp
parentc989c1b068e944908d185bfab67b64bc52a072d0 (diff)
downloadruby-45740e7a248b4b995644646e38d94b8be44fc60c.tar.gz
[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
Diffstat (limited to 'yarp')
-rw-r--r--yarp/defines.h5
1 files changed, 5 insertions, 0 deletions
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