#if defined(__GNUC__) && (__GNUC__ > 2)
#define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
#define DP_FUNC_PURE __attribute__ ((pure))
+#define DP_FUNC_NORETURN __attribute__ ((noreturn))
#else
#define DP_FUNC_PRINTF(n)
#define DP_FUNC_PURE
+#define DP_FUNC_NORETURN
#endif
#include <sys/types.h>
#include "keys.h"
#include "console.h"
#include "menu.h"
+#include "csprogs.h"
extern qboolean noclip_anglehack;
extern cvar_t developer_loadfile;
extern cvar_t developer_loading;
+extern cvar_t sessionid;
+
#define STARTCONFIGFILENAME "quake.rc"
#define CONFIGFILENAME "config.cfg"
# undef SSE2_PRESENT
#endif
-#ifdef SSE2_PRESENT
-#define Sys_HaveSSE() true
-#define Sys_HaveSSE2() true
-#elif defined(SSE_POSSIBLE)
+#ifdef SSE_POSSIBLE
// runtime detection of SSE/SSE2 capabilities for x86
qboolean Sys_HaveSSE(void);
qboolean Sys_HaveSSE2(void);
extern int host_framecount;
/// not bounded in any way, changed at start of every frame, never reset
extern double realtime;
+/// equal to Sys_DirtyTime() at the start of this host frame
+extern double host_dirtytime;
void Host_InitCommands(void);
void Host_Main(void);
void Host_Shutdown(void);
void Host_StartVideo(void);
-void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1);
+void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN;
void Host_Quit_f(void);
void Host_ClientCommands(const char *fmt, ...) DP_FUNC_PRINTF(1);
void Host_ShutdownServer(void);
void Host_Reconnect_f(void);
void Host_NoOperation_f(void);
+void Host_LockSession(void);
+void Host_UnlockSession(void);
void Host_AbortCurrentFrame(void);
#define ISWHITESPACEORCONTROL(ch) ((signed char) (ch) <= (signed char) ' ')
+#ifdef PRVM_64
+#define FLOAT_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFFFFFFFFFF) // also match "negative zero" doubles of value 0x8000000000000000
+#define FLOAT_LOSSLESS_FORMAT "%.17g"
+#define VECTOR_LOSSLESS_FORMAT "%.17g %.17g %.17g"
+#else
#define FLOAT_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFF) // also match "negative zero" floats of value 0x80000000
+#define FLOAT_LOSSLESS_FORMAT "%.9g"
+#define VECTOR_LOSSLESS_FORMAT "%.9g %.9g %.9g"
+#endif
+
+// originally this was _MSC_VER
+// but here we want to test the system libc, which on win32 is borked, and NOT the compiler
+#ifdef WIN32
+#define INT_LOSSLESS_FORMAT_SIZE "I64"
+#define INT_LOSSLESS_FORMAT_CONVERT_S(x) ((__int64)(x))
+#define INT_LOSSLESS_FORMAT_CONVERT_U(x) ((unsigned __int64)(x))
+#else
+#define INT_LOSSLESS_FORMAT_SIZE "j"
+#define INT_LOSSLESS_FORMAT_CONVERT_S(x) ((intmax_t)(x))
+#define INT_LOSSLESS_FORMAT_CONVERT_U(x) ((uintmax_t)(x))
+#endif
#endif