From 0f9adc182d1801a6a30c2d97cc23dbb5287a503a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 4 Jun 2002 16:17:10 +0000 Subject: [PATCH] win32 compile fixes --- configure.ac | 12 ++++++++---- libs/util/sys.c | 6 +++++- nq/source/sys_win.c | 1 - qw/source/sv_sys_win.c | 4 ---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 199ebeb58..d66562747 100644 --- a/configure.ac +++ b/configure.ac @@ -686,17 +686,21 @@ case "${host}" in i?86-*-mingw32*) SYSTYPE=WIN32 AC_MSG_RESULT([Win32 driver]) + WIN32_LIBS=' $(NET_LIBS)' ;; i?86-*-cygwin*) SYSTYPE=WIN32 AC_MSG_RESULT([Win32 driver]) + WIN32_LIBS=' $(NET_LIBS)' ;; *) SYSTYPE=POSIX AC_MSG_RESULT([default POSIX driver]) + WIN32_LIBS='' ;; esac AM_CONDITIONAL(SYSTYPE_WIN32, test "$SYSTYPE" = "WIN32") +AC_SUBST(WIN32_LIBS) dnl Check for ia32 AC_MSG_CHECKING(for an ia32 machine) @@ -1859,28 +1863,28 @@ AC_SUBST(plugin_ldflags) AC_SUBST(plugin_libadd) QFCC_DEPS='$(top_builddir)/libs/gamecode/engine/libQFgamecode.la $(top_builddir)/libs/util/libQFutil.la' -QFCC_LIBS="${QFCC_DEPS} ${WINMM}" +QFCC_LIBS="${QFCC_DEPS} "'$(WIN32_LIBS)' QFCC_INCS='-I$(top_srcdir)/tools/qfcc/include' AC_SUBST(QFCC_LIBS) AC_SUBST(QFCC_DEPS) AC_SUBST(QFCC_INCS) QFPROGS_DEPS='$(top_builddir)/libs/gamecode/engine/libQFgamecode.la $(top_builddir)/libs/util/libQFutil.la' -QFPROGS_LIBS="${QFPROGS_DEPS} ${WINMM}" +QFPROGS_LIBS="${QFPROGS_DEPS} "'$(WIN32_LIBS)' QFPROGS_INCS='-I$(top_srcdir)/tools/qfprogs/include' AC_SUBST(QFPROGS_LIBS) AC_SUBST(QFPROGS_DEPS) AC_SUBST(QFPROGS_INCS) QWAQ_DEPS='$(top_builddir)/libs/gamecode/engine/libQFgamecode.la $(top_builddir)/libs/util/libQFutil.la' -QWAQ_LIBS="${QWAQ_DEPS} ${WINMM}" +QWAQ_LIBS="${QWAQ_DEPS} "'$(WIN32_LIBS)' QWAQ_INCS='' AC_SUBST(QWAQ_LIBS) AC_SUBST(QWAQ_DEPS) AC_SUBST(QWAQ_INCS) PAK_DEPS='$(top_builddir)/libs/util/libQFutil.la' -PAK_LIBS="${PAK_DEPS} ${WINMM}" +PAK_LIBS="${PAK_DEPS} "'$(WIN32_LIBS)' PAK_INCS="" AC_SUBST(PAK_LIBS) AC_SUBST(PAK_DEPS) diff --git a/libs/util/sys.c b/libs/util/sys.c index 065210ce2..a193e5b26 100644 --- a/libs/util/sys.c +++ b/libs/util/sys.c @@ -41,6 +41,9 @@ static const char rcsid[] = #ifdef HAVE_LIMITS_H # include #endif +#ifdef HAVE_CONIO_H +# include +#endif #ifdef HAVE_IO_H # include #endif @@ -471,6 +474,7 @@ Sys_CheckInput (int idle, int net_socket) struct timeval *timeout = 0; #ifdef _WIN32 + int sleep_msec; // Now we want to give some processing time to other applications, // such as qw_client, running on this machine. sleep_msec = sys_sleep->int_val; @@ -515,7 +519,7 @@ const char * Sys_ConsoleInput (void) { static char text[256]; - int len; + int len = 0; #ifdef _WIN32 int c; diff --git a/nq/source/sys_win.c b/nq/source/sys_win.c index 097efbb31..d047d0094 100644 --- a/nq/source/sys_win.c +++ b/nq/source/sys_win.c @@ -63,7 +63,6 @@ qboolean WinNT; static double pfreq; static int lowshift; qboolean isDedicated; -static qboolean sc_return_on_enter = false; HANDLE hinput, houtput; static const char tracking_tag[] = "Clams & Mooses"; diff --git a/qw/source/sv_sys_win.c b/qw/source/sv_sys_win.c index 39e64722f..a4f6d4bd9 100644 --- a/qw/source/sv_sys_win.c +++ b/qw/source/sv_sys_win.c @@ -31,9 +31,6 @@ static const char rcsid[] = # include "config.h" #endif -#include -#include -#include #include #include "QF/cvar.h" @@ -83,7 +80,6 @@ int main (int argc, const char **argv) { double newtime, time, oldtime; - int sleep_msec; COM_InitArgv (argc, argv);