check for asprintf instead of _MSC_VER - better for mingw

This commit is contained in:
Mike Dirolf 2009-12-18 14:19:53 -05:00
parent 9ba194c4b1
commit f8d45c405e
2 changed files with 5 additions and 1 deletions

View File

@ -112,7 +112,9 @@ static void write_utf8(buffer_t buffer, VALUE string, char check_null) {
/* TODO we ought to check that the malloc or asprintf was successful
* and raise an exception if not. */
#ifdef _MSC_VER
/* TODO maybe we can use something more portable like vsnprintf instead
* of this hack. And share it with the Python extension ;) */
#ifndef HAVE_ASPRINTF
#define INT2STRING(buffer, i) \
{ \
int vslength = _scprintf("%d", i) + 1; \

View File

@ -1,5 +1,7 @@
require 'mkmf'
have_func("asprintf")
have_header("ruby/st.h") || have_header("st.h")
have_header("ruby/regex.h") || have_header("regex.h")
have_header("ruby/encoding.h")