[nexuiz-commits] r6572 - in trunk/data/qcsrc: client common menu server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Apr 22 15:46:45 EDT 2009


Author: div0
Date: 2009-04-22 15:46:44 -0400 (Wed, 22 Apr 2009)
New Revision: 6572

Modified:
   trunk/data/qcsrc/client/Main.qc
   trunk/data/qcsrc/common/util.qc
   trunk/data/qcsrc/common/util.qh
   trunk/data/qcsrc/menu/menu.qc
   trunk/data/qcsrc/server/g_world.qc
Log:
detect the current fteqcc compiler bug, and abort if the progs are horribly broken because of it


Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc	2009-04-22 18:19:28 UTC (rev 6571)
+++ trunk/data/qcsrc/client/Main.qc	2009-04-22 19:46:44 UTC (rev 6572)
@@ -56,6 +56,8 @@
 	}
 #pragma target FTE
 #endif
+	
+	check_unacceptable_compiler_bugs();
 
 	float i;
 	CSQC_CheckEngine();

Modified: trunk/data/qcsrc/common/util.qc
===================================================================
--- trunk/data/qcsrc/common/util.qc	2009-04-22 18:19:28 UTC (rev 6571)
+++ trunk/data/qcsrc/common/util.qc	2009-04-22 19:46:44 UTC (rev 6572)
@@ -1614,3 +1614,18 @@
 	}
 	return v;
 }
+
+
+float _unacceptable_compiler_bug_1_a(float b, float c) { return b == c; }
+float _unacceptable_compiler_bug_1_b() { return 1; }
+float _unacceptable_compiler_bug_1_c(float d) { return 2 * d; }
+float _unacceptable_compiler_bug_1_d() { return 1; }
+
+void check_unacceptable_compiler_bugs()
+{
+	if(cvar("_allow_unacceptable_compiler_bugs"))
+		return;
+	tokenize_sane("foo bar");
+	if(strcat(argv(0), substring("foo bar", 4, 7 - argv_start_index(1))) == "barbar")
+		error("fteqcc bug introduced with revision 3178 detected. Please upgrade fteqcc to a later revision, downgrade fteqcc to revision 3177, or pester Spike until he fixes it. You can set _allow_unacceptable_compiler_bugs 1 to skip this check, but expect stuff to be horribly broken then.");
+}

Modified: trunk/data/qcsrc/common/util.qh
===================================================================
--- trunk/data/qcsrc/common/util.qh	2009-04-22 18:19:28 UTC (rev 6571)
+++ trunk/data/qcsrc/common/util.qh	2009-04-22 19:46:44 UTC (rev 6572)
@@ -166,3 +166,5 @@
 // solution 2 -> y
 // z = 1 if a real solution exists, 0 if not
 // if no real solution exists, x contains the real part and y the imaginary part of the complex solutions x+iy and x-iy
+
+void check_unacceptable_compiler_bugs();

Modified: trunk/data/qcsrc/menu/menu.qc
===================================================================
--- trunk/data/qcsrc/menu/menu.qc	2009-04-22 18:19:28 UTC (rev 6571)
+++ trunk/data/qcsrc/menu/menu.qc	2009-04-22 19:46:44 UTC (rev 6572)
@@ -21,6 +21,7 @@
 void() m_init =
 {
 	dprint_load();
+	check_unacceptable_compiler_bugs();
 }
 
 void UpdateConWidthHeight()

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2009-04-22 18:19:28 UTC (rev 6571)
+++ trunk/data/qcsrc/server/g_world.qc	2009-04-22 19:46:44 UTC (rev 6572)
@@ -386,6 +386,8 @@
 
 	remove = remove_safely; // during spawning, watch what you remove!
 
+	check_unacceptable_compiler_bugs();
+
 	if(cvar_string("cvar_check_default") != "bypass")
 	{
 		if(cvar_string("cvar_check_default") != CVAR_CHECK_DEFAULT)



More information about the nexuiz-commits mailing list