From e756daa26163aab3254bf5ebd8e14b10a4fe9f0e Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Wed, 24 Apr 2013 22:36:48 +0200 Subject: [PATCH] Remove sprintf warnings on Windows and fix sprintf-related fails on Mac --- builtins/builtins.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/builtins/builtins.c b/builtins/builtins.c index 8d687698..f6c385fb 100644 --- a/builtins/builtins.c +++ b/builtins/builtins.c @@ -50,6 +50,16 @@ available to ispc programs at compile time automatically. */ +#ifdef _MSC_VER +// We do want old school sprintf and don't want secure Microsoft extensions. +// And we also don't want warnings about it, so the define. +#define _CRT_SECURE_NO_WARNINGS +#else +// Some versions of glibc has "fortification" feature, which expands sprintf +// to __builtin___sprintf_chk(..., __builtin_object_size(...), ...). +// We don't want this kind of expansion, as we don't support these intrinsics. +#define _FORTIFY_SOURCE 0 +#endif #ifndef _MSC_VER #include