diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-08-16 15:42:56 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-08-16 17:47:32 -0700 |
commit | 45740e7a248b4b995644646e38d94b8be44fc60c (patch) | |
tree | 47b3c41a573ff73ce79a8c55be3c9b157f771c13 /yarp | |
parent | c989c1b068e944908d185bfab67b64bc52a072d0 (diff) | |
download | ruby-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.h | 5 |
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 |