Now C++03 compatible

Sat, 06 Jun 2015 23:17:33 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sat, 06 Jun 2015 23:17:33 +0300
changeset 48
e121ea9dba93
parent 47
4a0ad0a08ea1
child 49
7a27d14a4df1

Now C++03 compatible

CMakeLists.txt file | annotate | diff | comparison | revisions
commonlib/types.h file | annotate | diff | comparison | revisions
launcher/demo.cpp file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Sat Jun 06 23:13:41 2015 +0300
+++ b/CMakeLists.txt	Sat Jun 06 23:17:33 2015 +0300
@@ -51,7 +51,7 @@
 set (ZCINEMA_RESOURCES zcinema.qrc)
 
 if (NOT MSVC)
-	set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall")
+	set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall")
 endif()
 
 include_directories ("${PROJECT_BINARY_DIR}")
--- a/commonlib/types.h	Sat Jun 06 23:13:41 2015 +0300
+++ b/commonlib/types.h	Sat Jun 06 23:17:33 2015 +0300
@@ -21,10 +21,6 @@
 #include <QList>
 #include <QVariant>
 
-template<class T> using list = QList<T>;
-template<class T> using initlist = std::initializer_list<T>;
-using std::size_t;
-
 typedef qint8 int8;
 typedef qint16 int16;
 typedef qint32 int32;
--- a/launcher/demo.cpp	Sat Jun 06 23:13:41 2015 +0300
+++ b/launcher/demo.cpp	Sat Jun 06 23:17:33 2015 +0300
@@ -20,6 +20,7 @@
 #include <QDataStream>
 #include <QMessageBox>
 #include <QProcess>
+#include <errno.h>
 #include <commonlib/misc.h>
 #include <commonlib/config.h>
 #include <commonlib/version.h>
@@ -37,18 +38,20 @@
 	QString out;
 	int skip = 0;
 
-	for (QChar c : in)
+	for (int i = 0; i < in.length(); ++i)
 	{
 		if (skip-- > 0)
 			continue;
 
-		if (c == QChar ('\034'))
+		QChar ch = in[i];
+
+		if (ch == QChar ('\034'))
 		{
 			skip = 1;
 			continue;
 		}
 
-		out += c;
+		out += ch;
 	}
 
 	return out;
@@ -305,8 +308,9 @@
 	QStringList pwadpaths;
 
 	// Find the WADs
-	for (const QString& wad : wads)
+	for (int i = 0; i < wads.size(); ++i)
 	{
+		const QString& wad = wads[i];
 		QString path = findWAD (wad);
 
 		// WAD names are case-sensitive under non-Windows and they can appear in uppercase
@@ -330,15 +334,15 @@
 	{
 		QString pwadtext;
 
-		for (const QString& wad : wads)
+		for (int i = 0; i < wads.size(); ++i)
 		{
-			if (&wad == &wads.first())
+			if (i == 0)
 				continue; // skip the IWAD
 
 			if (not pwadtext.isEmpty())
 				pwadtext += "<br />";
 
-			pwadtext += wad;
+			pwadtext += wads[i];
 		}
 
 		QDialog* dlg = new QDialog;

mercurial