]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_shared.c
fix glDrawRangeElements issue with mesa
[xonotic/darkplaces.git] / sys_shared.c
index e332f23b110246310393d4dd5d5fbc8cd2bb7d93..683fe0b13aba7b008e1373ed019ac0a3d6e04374 100644 (file)
@@ -10,7 +10,13 @@ static char sys_timestring[128];
 char *Sys_TimeString(const char *timeformat)
 {
        time_t mytime = time(NULL);
+#if _MSC_VER >= 1400
+       struct tm mytm;
+       localtime_s(&mytm, &mytime);
+       strftime(sys_timestring, sizeof(sys_timestring), timeformat, &mytm);
+#else
        strftime(sys_timestring, sizeof(sys_timestring), timeformat, localtime(&mytime));
+#endif
        return sys_timestring;
 }
 
@@ -25,10 +31,16 @@ void Sys_Quit (int returnvalue)
        exit(returnvalue);
 }
 
+#if defined(__linux__) || defined(__FreeBSD__)
+#ifdef __cplusplus
+extern "C"
+#endif
+int moncontrol(int);
+#endif
+
 void Sys_AllowProfiling(qboolean enable)
 {
 #if defined(__linux__) || defined(__FreeBSD__)
-int moncontrol(int);
        moncontrol(enable);
 #endif
 }