diff options
Diffstat (limited to 'src/sys')
-rw-r--r-- | src/sys/con_tty.c | 5 | ||||
-rw-r--r-- | src/sys/sys_local.h | 5 | ||||
-rw-r--r-- | src/sys/sys_main.c | 30 |
3 files changed, 27 insertions, 13 deletions
diff --git a/src/sys/con_tty.c b/src/sys/con_tty.c index 06dcc166..f128b0d7 100644 --- a/src/sys/con_tty.c +++ b/src/sys/con_tty.c @@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include <signal.h> #include <termios.h> #include <fcntl.h> +#include <sys/time.h> /* ============================================================= @@ -169,7 +170,7 @@ void CON_Shutdown( void ) } // Restore blocking to stdin reads - fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) & ~O_NDELAY ); + fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) & ~O_NONBLOCK ); } /* @@ -257,7 +258,7 @@ void CON_Init( void ) signal(SIGTTOU, SIG_IGN); // Make stdin reads non-blocking - fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) | O_NDELAY ); + fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) | O_NONBLOCK ); if (isatty(STDIN_FILENO)!=1) { diff --git a/src/sys/sys_local.h b/src/sys/sys_local.h index f2a4dddc..60c7e63a 100644 --- a/src/sys/sys_local.h +++ b/src/sys/sys_local.h @@ -23,6 +23,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../qcommon/q_shared.h" #include "../qcommon/qcommon.h" +// Require a minimum version of SDL +#define MINSDL_MAJOR 1 +#define MINSDL_MINOR 2 +#define MINSDL_PATCH 7 + // Input subsystem void IN_Init (void); void IN_Frame (void); diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c index 32c55e37..512c43b8 100644 --- a/src/sys/sys_main.c +++ b/src/sys/sys_main.c @@ -587,21 +587,29 @@ int main( int argc, char **argv ) char commandLine[ MAX_STRING_CHARS ] = { 0 }; #ifndef DEDICATED - const SDL_version *ver = SDL_Linked_Version( ); + // SDL version check + + // Compile time +# if !SDL_VERSION_ATLEAST(MINSDL_MAJOR,MINSDL_MINOR,MINSDL_PATCH) +# error A more recent version of SDL is required +# endif + + // Run time + const SDL_version *ver = SDL_Linked_Version( ); #define STRING(s) #s #define XSTRING(s) STRING(s) #define MINSDL_VERSION \ - XSTRING(MINSDL_MAJOR) "." \ - XSTRING(MINSDL_MINOR) "." \ - XSTRING(MINSDL_PATCH) - - if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) < - SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) ) - { - Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" ); - Sys_Exit( 1 ); - } + XSTRING(MINSDL_MAJOR) "." \ + XSTRING(MINSDL_MINOR) "." \ + XSTRING(MINSDL_PATCH) + + if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) < + SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) ) + { + Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" ); + Sys_Exit( 1 ); + } #endif Sys_ParseArgs( argc, argv ); |