[gl2ps] Patch for gl2psPrintf

David Lonie david.lonie at kitware.com
Mon Nov 5 16:14:29 CET 2012


On Mon, Nov 5, 2012 at 10:01 AM, Christophe Geuzaine
<cgeuzaine at ulg.ac.be> wrote:
>
> On 05 Nov 2012, at 14:23, David Lonie <david.lonie at kitware.com> wrote:
>
>> On Sun, Nov 4, 2012 at 8:43 AM, Christophe Geuzaine <cgeuzaine at ulg.ac.be> wrote:
>>>
>>> Hi David - Indeed, we should fix this. In Gmsh we need to check (at configure time) if vsnprintf is available... How should we handle this in gl2ps?
>>
>> Something like the following can be added to the CMakeLists.txt file for gl2ps:
>>
>> include(CheckFunctionExists)
>> check_function_exists(vsnprintf HAVE_VSNPRINTF)
>> if(NOT HAVE_VSNPRINTF)
>>  message(FATAL_ERROR "Compiler does not support function 'vsnprintf'.")
>> endif()
>
> Sure - but do we want this limitation? If not, I will just #ifdef the code with something like HAVE_NO_VSNPRINTF...

AFAIK, most (if not all) modern compilers should have this function
available. If we need to leave the old implementation for legacy
compilers that's up to you ;-)

Another possibility is to just disable compression for compilers
without vsnprintf, since it's only used for libz calls.

Dave