Open GoogleCodeExporter opened 9 years ago
strerror_s() may be defined since vs2005
Original comment by fifywang
on 8 Dec 2009 at 2:47
Searching for localtime_s finds
http://msdn.microsoft.com/en-us/library/a442x3ye(VS.80).aspx which seems to
indicate that this function is declared under Windows, in file time.h.
Looking at the file windows/port.h, we see the following block of code right at
the top:
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN /* We always want minimal includes */
#include <windows.h>
#include <winsock.h> /* for gethostname */
#include <io.h> /* because we so often use open/close/etc */
#include <direct.h> /* for _getcwd() */
#include <process.h> /* for _getpid() */
#include <stdio.h> /* read in vsnprintf decl. before redifining it */
#include <stdarg.h> /* template_dictionary.cc uses va_copy */
#include <string.h> /* for _strnicmp(), strerror_s() */
#include <time.h> /* for localtime_s() */
/* Note: the C++ #includes are all together at the bottom. This file is
* used by both C and C++ code, so we put all the C++ together.
*/
This seems to indicate that the variable _WIN32 is not defined. But this
article
http://stackoverflow.com/questions/662084/whats-the-difference-between-the-win32
-and-win32-defines-in-c seems to indicate that _WIN32 should automatically be
defined by your compiler...
Original comment by tom.ritc...@gmail.com
on 12 Oct 2010 at 3:50
Hi,
- @tom.ritchford .. VS.NET 2003 does not contain the localtime_s etc methods,
the link you provided is for VS.NET 2005. still its very easy to replace those
methods with the none-safe versions..
see
http://msdn.microsoft.com/en-us/library/bf12f0hc%28v=vs.71%29.aspx
http://msdn.microsoft.com/en-us/library/zc53h9bh%28v=vs.71%29.aspx
- This won't solve the varargs problem.. A way to get around this can be found
at
http://rclermont.blogspot.com/2008/05/macros-and-variable-arguments-in.html
But that would just be hacks just to let VS.NET 2003 compile..
Original comment by amanjit....@gmx.de
on 25 Sep 2011 at 3:49
Original issue reported on code.google.com by
pvshew...@gmail.com
on 6 Oct 2009 at 10:49