summaryrefslogtreecommitdiff
path: root/args.c
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2015-05-07 16:41:33 -0700
committerJohann <johannkoenig@google.com>2015-05-27 18:28:25 -0700
commitcad0eca25c36e9b8234aaecb4dedc25cbccd6d14 (patch)
treec0b5343334d1db418734d35492749daf0bb664cd /args.c
parented93470a69818c6fd7994fecbcf7fb1a7e8d2ccd (diff)
downloadlibvpx-cad0eca25c36e9b8234aaecb4dedc25cbccd6d14.tar
libvpx-cad0eca25c36e9b8234aaecb4dedc25cbccd6d14.tar.gz
libvpx-cad0eca25c36e9b8234aaecb4dedc25cbccd6d14.tar.bz2
libvpx-cad0eca25c36e9b8234aaecb4dedc25cbccd6d14.zip
Don't #define snprintf in VS 2015 or higher.
In VS 2015 and higher snprintf is supplied and therefore vsnprintf doesn't need to be defined. This also avoids problems caused by _snprintf being different from snprintf. This fixes a build break with VS 2015 and improves security. Originally submitted via chromium by brucedawson@chromium.org https://codereview.chromium.org/1055603003 Additionally break this MSVC-specific tweak to a new file, which will become the home of all such MSVC-specific things. This requires adding a dependency on msvc.h to every example which uses args.c and tools_common.h Change-Id: I35b5f8e7ea00f6627403aabc9ea79b0412557a99
Diffstat (limited to 'args.c')
-rw-r--r--args.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/args.c b/args.c
index 9dabc9bdd..14b031040 100644
--- a/args.c
+++ b/args.c
@@ -14,9 +14,7 @@
#include <limits.h>
#include "args.h"
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
+#include "vpx_ports/msvc.h"
#if defined(__GNUC__) && __GNUC__
extern void die(const char *fmt, ...) __attribute__((noreturn));