On 1 Jan 2010, at 18:16, Greg Ercolano wrote:

> imacarthur wrote:
>> On 30 Dec 2009, at 19:24, Greg Ercolano wrote:
>>>     Solution on win32 is to change _snprintf() to _snprintf_s()
>>>     with the _TRUNCATE macro as the third argument. But there's no
>>>     clear way to use a macro shortcut to do this (since this is a
>>>     varargs function), so a cross platform solution is tricky at best.
>>
>> Just tested this on Vista with mingw, and it fails exactly as Greg's
>> VS example fails (because mingw mainly just wraps the native system
>> libs in general.)
>>
>> However, the workaround of using _snprintf_s(...) doesn't look like
>> it will fly either, since neither _snprintf_s nor the _TRUNCATE macro
>> are defined in mingw...
>
>       So I guess mingw is using the BSD style definition,
>       ie. the non-gnu approach.

Hmm - I'd say that mingw is using the win32 definition, in so far as  
they don't actually provide the runtime libs as such at all.
Rather, they provide a set of lib<whatever>.a files that are just  
wrapper stubs for the MS built in DLL's already on the system, so for  
example there is a libmsvcrt.a provided, that stubs the system's  
stock msvcrt.dll and so on.

There are of course also a set of header files, that (more or less)  
mirror the win32 API as laid out by MS, but defined to match the  
provided stubs...

So, I assume we probably *can* get at the MS _snprintf_s method (it  
must be in the system DLL's after all), but the stock mingw library  
stubs and header files do not provide the hooks we need for access to  
it...

>
>       I'm guessing mingw's manpage for snprintf()
>       probably mentions this problem

Not as such - the mingw system provides no refs for the lib functions  
- the assumption (I always assumed!) is that you are essentially  
using the MS libs on the system, so the MS docs apply...




_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to