Skip to content

Commit ce2eedf

Browse files
committed
Compile without RTTI and replace dynamic_cast by static_cast
1 parent 099c9cd commit ce2eedf

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

tmxlite/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ SET(PROJECT_STATIC_RUNTIME FALSE CACHE BOOL "Use statically linked standard/runt
1313

1414
if(CMAKE_COMPILER_IS_GNUCXX OR APPLE)
1515
if(PROJECT_STATIC_RUNTIME)
16-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -static")
16+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-rtti -static")
1717
else()
18-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
18+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-rtti")
1919
endif()
2020
endif()
2121

tmxlite/include/tmxlite/ImageLayer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ namespace tmx
7979
inline ImageLayer& Layer::getLayerAs<ImageLayer>()
8080
{
8181
assert(getType() == Type::Image);
82-
return *dynamic_cast<ImageLayer*>(this);
82+
return *static_cast<ImageLayer*>(this);
8383
}
8484
}

tmxlite/include/tmxlite/LayerGroup.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ namespace tmx
7474
inline LayerGroup& Layer::getLayerAs<LayerGroup>()
7575
{
7676
assert(getType() == Type::Group);
77-
return *dynamic_cast<LayerGroup*>(this);
77+
return *static_cast<LayerGroup*>(this);
7878
}
7979
}

tmxlite/include/tmxlite/ObjectGroup.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ namespace tmx
8585
inline ObjectGroup& Layer::getLayerAs<ObjectGroup>()
8686
{
8787
assert(getType() == Type::Object);
88-
return *dynamic_cast<ObjectGroup*>(this);
88+
return *static_cast<ObjectGroup*>(this);
8989
}
9090
}

tmxlite/include/tmxlite/TileLayer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,6 @@ namespace tmx
105105
inline TileLayer& Layer::getLayerAs<TileLayer>()
106106
{
107107
assert(getType() == Type::Tile);
108-
return *dynamic_cast<TileLayer*>(this);
108+
return *static_cast<TileLayer*>(this);
109109
}
110110
}

0 commit comments

Comments
 (0)