summaryrefslogtreecommitdiff
path: root/source/sys_unix.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-02-17 22:53:39 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-02-17 22:53:39 +0000
commit4034314816f7ec9e26c9b9bfc2630c8ca0a24874 (patch)
treed48be98832d2d9cb977540541fae1acb1859142b /source/sys_unix.c
parenta5afaf65af8ef50d1ce8bbd9e2133239013c26f7 (diff)
Huge search and replace commit.
Use fixed size integer types from stdint.h instead of custom defined ones. Get endianess infromation form endian.h. Added `remotemode' console command. Link with -ldl only on Linux.
Diffstat (limited to 'source/sys_unix.c')
-rw-r--r--source/sys_unix.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/source/sys_unix.c b/source/sys_unix.c
index ad84705..afe3f09 100644
--- a/source/sys_unix.c
+++ b/source/sys_unix.c
@@ -53,10 +53,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#undef USE_SDL
#endif
-#ifdef USE_SDL
+#if USE_SDL
#include <SDL.h>
+#if USE_X11
#include <SDL_syswm.h>
#endif
+#endif
cvar_t *sys_basedir;
cvar_t *sys_libdir;
@@ -550,31 +552,9 @@ void Sys_DebugBreak( void ) {
raise( SIGTERM );
}
-/*
-================
-Sys_Milliseconds
-================
-*/
-int Sys_Milliseconds( void ) {
- struct timeval tp;
- static int secbase;
- int curtime;
-
- gettimeofday( &tp, NULL );
-
- if( !secbase ) {
- secbase = tp.tv_sec;
- return tp.tv_usec / 1000;
- }
-
- curtime = ( tp.tv_sec - secbase ) * 1000 + tp.tv_usec / 1000;
-
- return curtime;
-}
-
-uint32 Sys_Realtime( void ) {
+unsigned Sys_Milliseconds( void ) {
struct timeval tp;
- uint32 time;
+ unsigned time;
gettimeofday( &tp, NULL );
time = tp.tv_sec * 1000 + tp.tv_usec / 1000;
@@ -668,7 +648,7 @@ Sys_GetClipboardData
=================
*/
char *Sys_GetClipboardData( void ) {
-#if USE_SDL
+#if USE_SDL && USE_X11
SDL_SysWMinfo info;
Display *dpy;
Window sowner, win;
@@ -807,7 +787,7 @@ void Sys_FillAPI( sysAPI_t *api ) {
void Sys_FixFPCW( void ) {
#ifdef __i386__
- uint16 cw;
+ uint16_t cw;
__asm__ __volatile__( "fnstcw %0" : "=m" (cw) );