[llvm-commits] [llvm] r91842 - /llvm/trunk/include/llvm/Support/Format.h

Anton Korobeynikov asl at math.spbu.ru
Mon Dec 21 12:19:37 PST 2009


Author: asl
Date: Mon Dec 21 14:19:37 2009
New Revision: 91842

URL: http://llvm.org/viewvc/llvm-project?rev=91842&view=rev
Log:
Remove uber-gross hack. The define _snprintf to snprintf is invalid due to two reasons: 1. Accroding to C++ standard snprintf should be available in std namespace (and __gnu_cxx in case of GCC to). Such ifdef will change all snprintf's to _snprintf's, but won't bring snprintf to all necessary namespaces. Thus e.g. any locale-using code on mingw will yield an error (include this file + string to see the result) 2. MSVCRT's _snprintf does not comply with C99 standard. Standard one is snprintf.

Modified:
    llvm/trunk/include/llvm/Support/Format.h

Modified: llvm/trunk/include/llvm/Support/Format.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Format.h?rev=91842&r1=91841&r2=91842&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/Format.h (original)
+++ llvm/trunk/include/llvm/Support/Format.h Mon Dec 21 14:19:37 2009
@@ -25,9 +25,6 @@
 
 #include <cassert>
 #include <cstdio>
-#ifdef WIN32
-#define snprintf _snprintf
-#endif
 
 namespace llvm {
 





More information about the llvm-commits mailing list