]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/common/inout.c
Merge commit '173f350be76237a7dee9c00c389dff4e56b3da4c' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / common / inout.c
index 827bdceb3b84e8d982f83aa82c604b277e21291b..1a7c6b8a0be3ff655c8437074dba4fde9d7280c9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
    For a list of contributors, see the accompanying CONTRIBUTORS file.
 
    This file is part of GtkRadiant.
@@ -26,6 +26,7 @@
 // deal with in/out tasks, for either stdin/stdout or network/XML stream
 //
 
+#include "globaldefs.h"
 #include "cmdlib.h"
 #include "mathlib.h"
 #include "polylib.h"
@@ -33,7 +34,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
 #include <direct.h>
 #include <windows.h>
 #endif
@@ -45,7 +46,7 @@
 // utf8 conversion
 #include <glib.h>
 
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
 HWND hwndOut = NULL;
 qboolean lookedForServer = qfalse;
 UINT wm_BroadcastCommand = -1;
@@ -55,6 +56,7 @@ socket_t *brdcst_socket;
 netmessage_t msg;
 
 qboolean verbose = qfalse;
+qboolean werror = qfalse;
 
 // our main document
 // is streamed through the network to Radiant
@@ -151,7 +153,7 @@ void xml_Select( char *msg, int entitynum, int brushnum, qboolean bError ){
        xmlNodeAddContent( node, (xmlChar*)buf );
        level[0] = (int)'0' + ( bError ? SYS_ERR : SYS_WRN )  ;
        level[1] = 0;
-       xmlSetProp( node, (xmlChar*)"level", (xmlChar *)&level );
+       xmlSetProp( node, (xmlChar*)"level", (xmlChar*)&level );
        // a 'select' information
        sprintf( buf, "%i %i", entitynum, brushnum );
        select = xmlNewNode( NULL, (xmlChar*)"brush" );
@@ -315,6 +317,11 @@ void Sys_FPrintf( int flag, const char *format, ... ){
        vsprintf( out_buffer, format, argptr );
        va_end( argptr );
 
+       if ( ( flag == SYS_WRN ) && ( werror == qtrue ) ) {
+               Error( out_buffer );
+               return;
+       }
+
        FPrintf( flag, out_buffer );
 }