widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #14851
[Merge] lp:~widelands-dev/widelands/bug-1699852-compiler-warning into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1699852-compiler-warning into lp:widelands.
Commit message:
Fix [-Wundefined-func-template] compiler warnings.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1699852 in widelands: "Instantiation warnings from maptriangleregion.h"
https://bugs.launchpad.net/widelands/+bug/1699852
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1699852-compiler-warning/+merge/355884
All this one needed in the end was declaring the template variants from the .cc files in the .h files.
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1699852-compiler-warning into lp:widelands.
=== modified file 'src/logic/mapfringeregion.h'
--- src/logic/mapfringeregion.h 2018-04-07 16:59:00 +0000
+++ src/logic/mapfringeregion.h 2018-09-30 06:27:41 +0000
@@ -77,6 +77,10 @@
typename AreaType::RadiusType remaining_in_phase_;
uint8_t phase_;
};
+
+// Forward declarations of template instantiations
+template <> bool MapFringeRegion<Area<FCoords>>::advance(const Map& map);
+template <> bool MapFringeRegion<Area<>>::advance(const Map& map);
}
#endif // end of include guard: WL_LOGIC_MAPFRINGEREGION_H
=== modified file 'src/logic/maphollowregion.h'
--- src/logic/maphollowregion.h 2018-04-07 16:59:00 +0000
+++ src/logic/maphollowregion.h 2018-09-30 06:27:41 +0000
@@ -72,6 +72,10 @@
uint32_t rowpos_; // # of fields we have returned in this row
typename AreaType::CoordsType left_; // left-most node of current row
};
+
+// Forward declarations of template instantiations
+template<> MapHollowRegion<Area<>>::MapHollowRegion(const Map& map, const HollowArea<Area<>>& hollow_area);
+template <> bool MapHollowRegion<Area<>>::advance(const Map& map);
}
#endif // end of include guard: WL_LOGIC_MAPHOLLOWREGION_H
=== modified file 'src/logic/maptriangleregion.h'
--- src/logic/maptriangleregion.h 2018-04-07 16:59:00 +0000
+++ src/logic/maptriangleregion.h 2018-09-30 06:27:41 +0000
@@ -121,6 +121,13 @@
CoordsType left_;
TCoords<CoordsType> location_;
};
+
+// Forward declarations of template instantiations
+template<> MapTriangleRegion<>::MapTriangleRegion(const Map& map, Area<TCoords<>> area);
+template<> bool MapTriangleRegion<>::advance(const Map& map);
+
+template<> MapTriangleRegion<TCoords<FCoords>>::MapTriangleRegion(const Map& map, Area<TCoords<FCoords>> area);
+template<> bool MapTriangleRegion<TCoords<FCoords>>::advance(const Map& map);
}
#endif // end of include guard: WL_LOGIC_MAPTRIANGLEREGION_H
Follow ups