Patch for master attached.
Will treat this issue as emergency build fix - no review period required before I may push fixes in. Given how long autotools based Windows builds take, I may even test only that fixes don't break linux, not that they really fix Windows, before pushing them in.
S3_1 version attached
S3_0 and S2_6 versions.
It seems that much bigger rearrangements are needed for fixing all the cases, and also the deinitialization part.
Attached new master version. Changes listed in commit message:
- fc_interface_init() renamed as libfreeciv_init()
- free_libfreeciv() renamed as libfreeciv_free()
- libfreeciv_init() takes a parameter telling if fc_interface check should be done, so programs without fc_interface can use it
- libfreciv_init() call added to modpack installer
- In other programs libfreeciv_init() call moved earlier, as needed
- init_nls() / free_nls() calls moved inside libfreeciv_init() / libfreeciv_free() to have them exactly right time
Another version for master, with unnecessary include removed. Up-to-date patches for all the other branches too.
I already know this still crashes on exit in Windows, but that's a minor issue compared to crash on start -> likely leave to a later ticket, and get forward with this.
Server crashes on Windows.
init_nls() gets first called before fc_support_init() that initializes support mutexes, including that of fallback fc_vsnprintf() implementation used on Windows. Another Windows specialty in play is that init_nls() might call fc_vsnprintf() for LANG setup.