Commit 89cfba79 authored by Christian Stenger's avatar Christian Stenger Committed by Friedemann Kleint
Browse files

zeroconf: Compile fix for MinGW



Change-Id: I08120e945fea6455ea109926b9b0a95406d078da
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 7f44d7b2
......@@ -745,26 +745,6 @@
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
#if (( !defined( _MSC_VER ) || TARGET_OS_WINDOWS_CE ) && !defined( _WIN32 ) )
typedef long int intptr_t;
......
......@@ -79,9 +79,33 @@ namespace ZeroConf { namespace embeddedLib {
DWORD err = WSAGetLastError();
(void) priority;
va_start( args, message );
#ifdef _MSC_VER
len = _vscprintf( message, args ) + 1;
buffer = reinterpret_cast<char*>(malloc( len * sizeof(char) ));
if ( buffer ) { vsprintf( buffer, message, args ); OutputDebugStringA( buffer ); free( buffer ); }
if ( buffer ) {
vsprintf(buffer, message, args);
OutputDebugStringA(buffer);
free(buffer);
}
#else // MinGW 4.4, no longer required for 4.6
len = vsnprintf(NULL, 0, message, args);
va_end(args);
if (len == -1) // encoding error
return;
buffer = reinterpret_cast<char*>(malloc((len + 1) * sizeof(char)));
if (buffer == NULL) // no memory allocation possible
return;
va_start(args, message);
len = vsnprintf(buffer, (len + 1) * sizeof(char), message, args);
va_end(args);
if (len == -1) { // encoding error
free(buffer);
return;
} else {
OutputDebugStringA(buffer);
free(buffer);
}
#endif
WSASetLastError( err );
}
}}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment