Ignore:
Timestamp:
Jun 17, 2012, 2:36:30 PM (9 years ago)
Author:
Sam Hocevar
Message:

win32: define a custom sprintf_s() weak symbol. The VS2010 runtime does not
provide the deprecated snprintf(). The mingw32 runtime does not provide the
MS-specific sprintf_s(). Mingw-w64 copes with both. So we switch to sprintf_s
but also provide it as a weak symbol so that mingw32 does not complain.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/string.c

    r4819 r4822  
    3636#include "caca.h"
    3737#include "caca_internals.h"
     38
     39#if defined _WIN32 && defined __GNUC__ && __GNUC__ >= 3
     40int vsnprintf_s(char *s, size_t n, size_t c,
     41                const char *fmt, va_list args) CACA_WEAK;
     42#endif
    3843
    3944/** \brief Set cursor position.
     
    597602    return 0;
    598603}
     604
     605/*
     606 * Functions for the mingw32 runtime
     607 */
     608
     609#if defined _WIN32 && defined __GNUC__ && __GNUC__ >= 3
     610int vsnprintf_s(char *s, size_t n, size_t c, const char *fmt, va_list args)
     611{
     612    return vsnprintf(s, n, fmt, args);
     613}
     614#endif
    599615
    600616/*
Note: See TracChangeset for help on using the changeset viewer.