id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
2649	"CPLScanPointer doesn't do its job rightly when compiled	in MSYS environment"	ajolma	warmerdam	"CPLScanPointer uses
{{{
#if defined(WIN32) && defined(_MSC_VER)
}}}
to test whether to give sscanf a hex without the 0x prefix. The requirement is (probably) a feature of sscanf in msvcrt.dll. This does not work for MSYS, which does not define _MSC_VER. Instead MSYS (MinGW gcc?) defines __MSVCRT__ to indicate that it will be using msvcrt.dll (and not msys-1.0.dll).

The question is now how to fix this. In this case the issue is the runtime that is used and not the compiler. If _MSC_VER checks for the compiler, then it shouldn't be used here. See similar discussion here: http://mail.gnome.org/archives/xml/2002-October/msg00002.html Maybe we should use __MSVCRT__ every time the runtime is the issue and somewhere in configuration add
{{{
#ifdef _MSC_VER
#define __MSVCRT__
#endif
}}}
"	defect	closed	normal		ConfigBuild	unspecified	normal	fixed	mingw	mloskot dron
