diff --git a/CMakeLists.txt b/CMakeLists.txt
index eea89b1..1944a7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@
#
set(mySourceDirRel "src/") # Common values are "" or "src"
-set(additionalSources ${CMAKE_SOURCE_DIR}/rts/System/Util.cpp)
+set(additionalSources ${CMAKE_SOURCE_DIR}/rts/System/StringUtil.cpp)
set(additionalSources ${additionalSources} ${CMAKE_SOURCE_DIR}/rts/System/Misc/SpringTime.cpp)
if (WIN32) # spring::condition_variable_any requirement
set(additionalSources ${additionalSources} ${CMAKE_SOURCE_DIR}/rts/System/Platform/Win/CriticalSection.cpp)
diff --git a/src/circuit/CircuitAI.cpp b/src/circuit/CircuitAI.cpp
index 612a497..b23c01b 100644
--- a/src/circuit/CircuitAI.cpp
+++ b/src/circuit/CircuitAI.cpp
@@ -24,7 +24,7 @@
#include "resource/EnergyGrid.h"
#endif
-#include "System/Util.h"
+#include "System/StringUtil.h"
#include "AISEvents.h"
#include "AISCommands.h"
#include "SSkirmishAICallback.h" // "direct" C API
diff --git a/src/circuit/setup/SetupManager.h b/src/circuit/setup/SetupManager.h
index daa7aaa..2cd0d28 100644
--- a/src/circuit/setup/SetupManager.h
+++ b/src/circuit/setup/SetupManager.h
@@ -10,8 +10,8 @@
#include "unit/CircuitDef.h"
#include "json/json-forwards.h"
-
#include "AIFloat3.h"
+#include <functional>
namespace circuit {
diff --git a/src/circuit/util/GameTask.h b/src/circuit/util/GameTask.h
index 76ddb04..1f11d91 100644
--- a/src/circuit/util/GameTask.h
+++ b/src/circuit/util/GameTask.h
@@ -10,6 +10,7 @@
#define SRC_CIRCUIT_UTIL_GAMETASK_H_
#include <memory>
+#include <functional>
namespace circuit {
@@ -17,7 +18,7 @@ class CGameTask {
public:
template<typename _Callable, typename... _Args>
explicit CGameTask(_Callable&& __f, _Args&&... __args) {
- __b = _M_make_routine(std::__bind_simple(std::forward<_Callable>(__f), std::forward<_Args>(__args)...));
+ __b = _M_make_routine(std::bind(std::forward<_Callable>(__f), std::forward<_Args>(__args)...));
}
virtual ~CGameTask();
diff --git a/src/circuit/util/utils.h b/src/circuit/util/utils.h
index 9cf5b47..e929d7d 100644
--- a/src/circuit/util/utils.h
+++ b/src/circuit/util/utils.h
@@ -10,7 +10,7 @@
#include "util/Defines.h"
-#include "System/Util.h"
+#include "System/StringUtil.h"
#include "System/Threading/SpringThreading.h"
#include <chrono>
There is a SIGSEGV at game end but it may be a spring (103.0.1-1017-gfe0d9ebd8) issue:
#0 0x000000003fa37e00 in ?? ()
#1 0x00007f7501e63b48 in circuit::CTerrainManager::MarkBlockerByMask (this=this@entry=0x113f8d10, building=..., block=<optimized out>, mask=0x3fa57a48)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/terrain/TerrainManager.cpp:924
#2 0x00007f7501e64860 in circuit::CTerrainManager::MarkBlocker (this=this@entry=0x113f8d10, building=..., block=block@entry=false)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/terrain/TerrainManager.cpp:993
#3 0x00007f7501e64bbc in circuit::CTerrainManager::DelBlocker (this=0x113f8d10, cdef=<optimized out>, pos=..., facing=3)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/terrain/TerrainManager.cpp:335
#4 0x00007f7501e37299 in circuit::IUnitTask::Close (this=this@entry=0x2b393960, done=<optimized out>)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/task/UnitTask.cpp:66
#5 0x00007f7501e3a1fd in circuit::IBuilderTask::Close (this=0x2b393960, done=<optimized out>)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/task/builder/BuilderTask.cpp:231
#6 0x00007f7501dc34e5 in circuit::CBuilderManager::DequeueTask (this=<optimized out>, task=0x2b393960, done=<optimized out>)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/module/BuilderManager.cpp:606
#7 0x00007f7501dc2a90 in circuit::CBuilderManager::Release (this=0x376f7b90)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/module/BuilderManager.cpp:828
#8 0x00007f7501da7dd8 in circuit::CCircuitAI::Release (this=0x37db1000, reason=-1) at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/CircuitAI.cpp:635
#9 0x00007f7501dac679 in circuit::CCircuitAI::HandleGameEvent (this=0x37db1000, topic=2, data=0x7ffe65329880)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/circuit/CircuitAI.cpp:205
#10 0x00007f7501da4af0 in handleEvent (skirmishAIId=<optimized out>, topic=2, data=0x7ffe65329880)
at /home/johanr/my_projects/spring/AI/Skirmish/CircuitAI/src/AIExport.cpp:75
#11 0x0000000000934deb in CSkirmishAILibrary::HandleEvent (this=0x65d90e0, skirmishAIId=2, topic=topic@entry=2, data=data@entry=0x7ffe65329880)
at /home/johanr/my_projects/spring/rts/ExternalAI/SkirmishAILibrary.cpp:94
#12 0x00000000009380c8 in CSkirmishAIWrapper::HandleEvent (this=this@entry=0x118c84e0, topic=topic@entry=2, data=data@entry=0x7ffe65329880)
at /home/johanr/my_projects/spring/rts/ExternalAI/SkirmishAIWrapper.cpp:467
#13 0x00000000009382a3 in CSkirmishAIWrapper::Release (reason=<optimized out>, this=0x118c84e0) at /home/johanr/my_projects/spring/rts/ExternalAI/SkirmishAIWrapper.cpp:238
#14 CSkirmishAIWrapper::~CSkirmishAIWrapper (this=0x118c84e0, __in_chrg=<optimized out>) at /home/johanr/my_projects/spring/rts/ExternalAI/SkirmishAIWrapper.cpp:117
#15 0x00000000009116a6 in std::default_delete<CSkirmishAIWrapper>::operator() (this=<optimized out>, __ptr=0x118c84e0) at /usr/include/c++/7.1.1/bits/unique_ptr.h:78
#16 std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> >::~unique_ptr (this=<optimized out>, __in_chrg=<optimized out>)
at /usr/include/c++/7.1.1/bits/unique_ptr.h:268
#17 std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > >::~pair (this=<optimized out>, __in_chrg=<optimized out>)
at /usr/include/c++/7.1.1/bits/stl_pair.h:198
#18 __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > >::destroy<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > (this=<optimized out>, __p=<optimized out>)
at /usr/include/c++/7.1.1/ext/new_allocator.h:140
#19 std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > > >::destroy<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > (__a=..., __p=<optimized out>)
at /usr/include/c++/7.1.1/bits/alloc_traits.h:487
#20 std::_Rb_tree<unsigned char, std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > >, std::_Select1st<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > >, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > >::_M_destroy_node (this=0x64c8900, __p=0x3d494810)
at /usr/include/c++/7.1.1/bits/stl_tree.h:650
#21 std::_Rb_tree<unsigned char, std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > >, std::_Select1st<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > >, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > >::_M_drop_node (this=0x64c8900, __p=0x3d494810) at /usr/include/c++/7.1.1/bits/stl_tree.h:658
#22 std::_Rb_tree<unsigned char, std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > >, std::_Select1st<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > >, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > >::_M_erase (this=this@entry=0x64c8900, __x=0x3d494810)
at /usr/include/c++/7.1.1/bits/stl_tree.h:1858
#23 0x0000000000911756 in std::_Rb_tree<unsigned char, std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > >, std::_Select1st<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > >, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > >::clear (this=0x64c8900) at /usr/include/c++/7.1.1/bits/stl_tree.h:1171
#24 std::_Rb_tree<unsigned char, std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > >, std::_Select1st<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > >, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > >::_M_erase_aux (__last={
first = 1 '\001',
second = std::unique_ptr<CSkirmishAIWrapper> containing 0x0
}, __first=..., this=0x64c8900) at /usr/include/c++/7.1.1/bits/stl_tree.h:2488
#25 std::_Rb_tree<unsigned char, std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > >, std::_Select1st<std::pair<unsi---Type <return> to continue, or q <return> to quit---
gned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > >, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > >::erase (this=this@entry=0x64c8900, __x=@0x7ffe6532996c: 2 '\002')
at /usr/include/c++/7.1.1/bits/stl_tree.h:2502
#26 0x00000000009106c1 in std::map<unsigned char, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> >, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, std::unique_ptr<CSkirmishAIWrapper, std::default_delete<CSkirmishAIWrapper> > > > >::erase (__x=@0x7ffe6532996c: 2 '\002', this=0x64c8900)
at /usr/include/c++/7.1.1/bits/stl_map.h:1048
#27 CEngineOutHandler::DestroySkirmishAI (this=this@entry=0x64c8900, skirmishAIId=<optimized out>) at /home/johanr/my_projects/spring/rts/ExternalAI/EngineOutHandler.cpp:621
#28 0x00000000009108d0 in CEngineOutHandler::~CEngineOutHandler (this=0x64c8900, __in_chrg=<optimized out>)
at /home/johanr/my_projects/spring/rts/ExternalAI/EngineOutHandler.cpp:83
#29 0x0000000000910941 in spring::SafeDelete<CEngineOutHandler*> (p=@0xeaf0a0: 0x0) at /home/johanr/my_projects/spring/rts/System/SafeUtil.h:22
#30 CEngineOutHandler::Destroy () at /home/johanr/my_projects/spring/rts/ExternalAI/EngineOutHandler.cpp:71
#31 0x0000000000499f91 in CGame::KillMisc (this=this@entry=0x3f6bc00) at /home/johanr/my_projects/spring/rts/Game/Game.cpp:825
#32 0x00000000004a555e in CGame::~CGame (this=0x3f6bc00, __in_chrg=<optimized out>) at /home/johanr/my_projects/spring/rts/Game/Game.cpp:321
#33 0x00000000004a5729 in CGame::~CGame (this=0x3f6bc00, __in_chrg=<optimized out>) at /home/johanr/my_projects/spring/rts/Game/Game.cpp:335
#34 0x0000000000896588 in spring::SafeDelete<CGame*> (p=<optimized out>) at /home/johanr/my_projects/spring/rts/System/SafeUtil.h:22
#35 SpringApp::ShutDown (fromRun=fromRun@entry=true) at /home/johanr/my_projects/spring/rts/System/SpringApp.cpp:878
#36 0x00000000008988e2 in SpringApp::ShutDown (fromRun=true) at /home/johanr/my_projects/spring/rts/System/SpringApp.cpp:820
#37 SpringApp::Run (this=this@entry=0x7ffe65329b20) at /home/johanr/my_projects/spring/rts/System/SpringApp.cpp:835
#38 0x000000000087ee29 in Run (argc=argc@entry=2, argv=argv@entry=0x7ffe65329cc8) at /home/johanr/my_projects/spring/rts/System/Main.cpp:43
#39 0x000000000045d655 in main (argc=2, argv=0x7ffe65329cc8) at /home/johanr/my_projects/spring/rts/System/Main.cpp:92