summarylogtreecommitdiffstats
path: root/0002-Fix-a-Linux-compilation-error.patch
blob: 073ed2d60235c030dfdfee168c52baa8cc87545a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From a51e39291a5a83909e6b4cac080dd8cfc358ae8f Mon Sep 17 00:00:00 2001
From: Yaohan Chen <yaohan.chen@gmail.com>
Date: Wed, 12 Aug 2015 19:16:46 -0400
Subject: [PATCH 2/2] Fix a Linux compilation error

A comparison between boost::optional and nullptr in src/tiled/tmx_reader.cpp
causes compilation to fail with boost version 1.58. This fixes it by
comparing with boost::none instead, which works in both the latest boost
and the bundled version.

Although this fix is not necessary for the bundled boost in the
compilation stage, on a Linux system the linking may fail because the
boost library on the system doesn't match the bundled boost headers.
---
 src/tiled/tmx_reader.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tiled/tmx_reader.cpp b/src/tiled/tmx_reader.cpp
index 3409d12..60c8e0f 100644
--- a/src/tiled/tmx_reader.cpp
+++ b/src/tiled/tmx_reader.cpp
@@ -139,7 +139,7 @@ namespace tiled
 	void TmxReader::parseMapElement(const boost::property_tree::ptree& pt)
 	{
 		auto attributes = pt.get_child_optional("<xmlattr>");
-		ASSERT_LOG(attributes != nullptr, "map elements must have a minimum number of attributes: 'version', 'orientation', 'width', 'height', 'tilewidth', 'tileheight'");
+		ASSERT_LOG(attributes != boost::none, "map elements must have a minimum number of attributes: 'version', 'orientation', 'width', 'height', 'tilewidth', 'tileheight'");
 		auto version = attributes->get_child("version").data();
 		auto orientation = attributes->get_child("orientation").data();
 		map_->setOrientation(convert_orientation(orientation));
@@ -201,7 +201,7 @@ namespace tiled
 	void TmxReader::parseTileset(const boost::property_tree::ptree& pt)
 	{
 		auto attributes = pt.get_child_optional("<xmlattr>");
-		ASSERT_LOG(attributes != nullptr, "tileset elements must have a minimum number of attributes: 'firstgid'");
+		ASSERT_LOG(attributes != boost::none, "tileset elements must have a minimum number of attributes: 'firstgid'");
 		int firstgid = attributes->get<int>("firstgid");
 		TileSet ts(firstgid);
 		
-- 
2.5.0