summaryrefslogtreecommitdiff
path: root/common/vdlog.cpp
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2012-05-11 02:08:26 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-05-24 13:55:31 +0200
commit60e850c6e48c5223d00591e1d85ad1a31dcd44c5 (patch)
treeda88128973e155c9ff4ade3e4a03a0068187e300 /common/vdlog.cpp
parent55cf72c2a81dd540db9c7626850f3f9ea26f91c6 (diff)
mingw: don't use *_s msvcrt variants
Apparently, it comes with a recent version of C library (msvcrt90?), but I don't know if we can/should ship also a MS dll. Probably it used to work with an inlined version with VS headers. The build can be tweaked to use the -non-_s variant with -DOLDMSVCRT CFLAGS.
Diffstat (limited to 'common/vdlog.cpp')
-rw-r--r--common/vdlog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/vdlog.cpp b/common/vdlog.cpp
index a0444d9..f84b5b3 100644
--- a/common/vdlog.cpp
+++ b/common/vdlog.cpp
@@ -52,7 +52,11 @@ VDLog* VDLog::get(TCHAR* path)
}
if (size != INVALID_FILE_SIZE && size > LOG_ROLL_SIZE) {
TCHAR roll_path[MAX_PATH];
+#ifdef OLDMSVCRT
+ swprintf(roll_path, L"%s.1", path);
+#else
swprintf_s(roll_path, MAX_PATH, L"%s.1", path);
+#endif
if (!MoveFileEx(path, roll_path, MOVEFILE_REPLACE_EXISTING)) {
return NULL;
}