freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] Need help to fix ftview waterfall


From: Dave Arnold
Subject: [ft-devel] Need help to fix ftview waterfall
Date: Tue, 08 Oct 2013 15:56:38 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

A recent addition to ftview.c was the use of "%n" printf format conversion in 
Render_Waterfall(). The problem is that Microsoft's library function _snprintf() disables 
this format by default. This breaks the waterfall feature for MSVC builds and for MinGW 
builds (there is an #ifdef _WIN32 macro that maps snprintf() to Microsoft's _snprintf()).

I am trying to apply the workaround of calling _set_printf_count_output(TRUE) at the start of 
main() in ftview.c. This will restore the "%n" functionality. I'm doing this under the 
same _WIN32 #ifdef as the above macro. I'm not bothering with ftgrid for now, because its call to 
_snprintf does not use the "%n" format.

This source change fixes the issue for MSVC builds, but causes a link error for MinGW 
builds, using the Makefile and gcc. The error is "undefined reference to 
`_set_printf_count_output'".

I think I need to add "-lmsvcr100" to the command line. Doing this manually 
fixes the link, but I'm not sure the proper way to do that in the demos Makefile. It 
needs to be specific to win32, perhaps specific to the version of Visual Studio (there 
are msvcr90 and msvcr80 libraries, too) and perhaps even specific to release/debug.

Or maybe there's a better fix that I haven't thought of.

Any advice?

Thanks.

-Dave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]