Author: wyoung
Date: Wed Dec 20 23:07:06 2006
New Revision: 1338
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1338&view=rev
Log:
A recent patch changed a localtime() call to the safer localtime_r(),
but that's pretty much POSIX-specific. Added a workaround for VC++,
using their localtime_s(), which is the same thing, just with the
arguments reversed. (What, you expected something different from
Microsoft??)
Modified:
trunk/lib/datetime.cpp
Modified: trunk/lib/datetime.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/datetime.cpp?rev=1338&r1=1337&r2=1338&view=diff
==============================================================================
--- trunk/lib/datetime.cpp (original)
+++ trunk/lib/datetime.cpp Wed Dec 20 23:07:06 2006
@@ -26,7 +26,7 @@
***********************************************************************/
#define MYSQLPP_NOT_HEADER
-#include "platform.h"
+#include "common.h"
#include "datetime.h"
@@ -187,7 +187,11 @@
DateTime::DateTime(time_t t)
{
struct tm tm;
+#if defined(_MSC_VER)
+ localtime_s(&tm, &t);
+#else
localtime_r(&t, &tm);
+#endif
year = tm.tm_year + 1900;
month = tm.tm_mon + 1;
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits