mail[Wesnoth-commits] r28783 - /trunk/src/util.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on August 20, 2008 - 07:45:
Author: mordante
Date: Wed Aug 20 07:14:30 2008
New Revision: 28783

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28783&view=rev
Log:
Now that MSVC 6 is no longer supported start to remove some helper code to 
work
around problems in that compiler. The first step is to comment out the code 
and
replace it with new helper code that uses the standard. The second step is to
remove the helper code and fix all callers. 

Patch 3/3 for step 1: Use std::string::push_back.

Modified:
    trunk/src/util.hpp

Modified: trunk/src/util.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/util.hpp?rev=28783&r1=28782&r2=28783&view=diff
==============================================================================
--- trunk/src/util.hpp (original)
+++ trunk/src/util.hpp Wed Aug 20 07:14:30 2008
@@ -164,6 +164,7 @@
 inline bool chars_equal_insensitive(char a, char b) { return tolower(a) == 
tolower(b); }
 inline bool chars_less_insensitive(char a, char b) { return tolower(a) < 
tolower(b); }
 
+#if 0
 /**
  *  A definition of 'push_back' for strings,
  * since some implementations don't support string::push_back
@@ -174,6 +175,15 @@
        str.resize(str.size()+1);
        str[str.size()-1] = c;
 }
+#else
+
+template<typename T, typename C>
+void push_back(T& str, C c)
+{      
+       str.push_back(c);
+}
+
+#endif
 
 #ifdef __GNUC__
 #define LIKELY(a)    __builtin_expect((a),1) // Tells GCC to optimize code 
so that if is likely to happen




Related Messages


Powered by MHonArc, Updated Wed Aug 20 08:01:04 2008