Skip to content

Commit

Permalink
Fix snprintf redefinition in Visual Studio build.
Browse files Browse the repository at this point in the history
The snprintf function is checked for redifinition in stdio.h, so we
should include this header before we decide to redefine it.
  • Loading branch information
john-preston committed May 24, 2017
1 parent 6883bbf commit 2993da5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@
void tgvoip_log_file_printf(char level, const char* msg, ...);
void tgvoip_log_file_write_header();

#if !defined(snprintf) && defined(_WIN32)
#ifdef _WIN32
// The snprintf function is checked for redifinition in stdio.h, so we
// should include this header before we decide to redefine it.
#include <stdio.h>
#ifndef snprintf
#define snprintf _snprintf
#endif
#endif

#if defined(__ANDROID__)

Expand Down

0 comments on commit 2993da5

Please sign in to comment.