]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_shared.c
open client sockets before video starts, so that the Windows Firewall
[xonotic/darkplaces.git] / sys_shared.c
index 64ca6abfb29961211dbfb9854c03b3aa03e412f5..91f72d41294aa9d14d6572ca6f3a09ee7b3a5d3b 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;
 }
 
@@ -18,11 +24,22 @@ char *Sys_TimeString(const char *timeformat)
 extern qboolean host_shuttingdown;
 void Sys_Quit (int returnvalue)
 {
+       if (COM_CheckParm("-profilegameonly"))
+               Sys_AllowProfiling(false);
        host_shuttingdown = true;
        Host_Shutdown();
        exit(returnvalue);
 }
 
+void Sys_AllowProfiling(qboolean enable)
+{
+#if defined(__linux__) || defined(__FreeBSD__)
+int moncontrol(int);
+       moncontrol(enable);
+#endif
+}
+
+
 /*
 ===============================================================================