mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mirb_completion.c: fix strndup for MinGW
Use _WIN32 instead of _MSC_VER to provide strndup implementation for all Windows compilers including MinGW/MSYS. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,10 @@
|
||||
/* Windows compatibility */
|
||||
#ifdef _MSC_VER
|
||||
#define strdup _strdup
|
||||
#endif
|
||||
|
||||
/* strndup is not available on Windows (MSVC and MinGW) */
|
||||
#ifdef _WIN32
|
||||
static char*
|
||||
strndup(const char *s, size_t n)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user