forked from premiere/premiere-libtorrent
fix build error in config.hpp when included by C-files (like the ed25519 source for instance)
This commit is contained in:
parent
3c47177bfe
commit
80011a4715
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "libtorrent/config.hpp"
|
#include "libtorrent/config.hpp" // for TORRENT_EXPORT
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -355,11 +355,17 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
// internal
|
// internal
|
||||||
inline int snprintf(char* buf, int len, char const* fmt, ...)
|
#ifdef __cplusplus
|
||||||
|
inline
|
||||||
|
#else
|
||||||
|
static
|
||||||
|
#endif
|
||||||
|
int snprintf(char* buf, int len, char const* fmt, ...)
|
||||||
{
|
{
|
||||||
va_list lp;
|
va_list lp;
|
||||||
|
int ret;
|
||||||
va_start(lp, fmt);
|
va_start(lp, fmt);
|
||||||
int ret = _vsnprintf(buf, len, fmt, lp);
|
ret = _vsnprintf(buf, len, fmt, lp);
|
||||||
va_end(lp);
|
va_end(lp);
|
||||||
if (ret < 0) { buf[len-1] = 0; ret = len-1; }
|
if (ret < 0) { buf[len-1] = 0; ret = len-1; }
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue