Commit Graph

218 Commits (4fb6b09b30abec70b742eaf9bcd90addde0185b8)

Author SHA1 Message Date
lethosor 8675ff660c Windows+Ninja: Fix build error due to trying to include " dfhack_llimits.h"
Ref #1455
2019-10-04 13:15:58 -04:00
lethosor dcce9ae599 Add quotes around dfhack_llimits.h include for MSVC
Fixes #1455
2019-10-04 13:07:26 -04:00
lethosor 8a07426643 Merge branch 'develop' into cmake-cleanup 2019-07-20 15:15:39 -04:00
lethosor b6678d72ae Move custom lualimit.h to lua dir and rename to dfhack_llimits.h 2019-07-20 14:26:30 -04:00
Pauli a90a6b2a7b Make lua data race free
Fixes tsan trace report between lua viewscreen and other threads running
lua without CoreSuspender lock. But I would assume similar races exists
when using lua from console thread, remote thread and vmethods same time.
2019-07-18 23:04:40 -04:00
lethosor 76da2c2aaf Clean up CMakeLists.txt style 2019-07-16 22:19:11 -04:00
Ben Lubar a5018c9b81
Exclude jsoncpp default CMake targets.
Removes the lib and include directories from the DFHack package.

Removes the status message that lists the jsoncpp version number.
2018-07-08 23:16:08 -05:00
Pauli 2b79b4cce7 Use jsoncpp 1.8.4 as a submodule
This makes jsoncpp a submodule that can be build directly from git
sources. This changes depends/jsoncpp to depends/jsoncpp-sub to avoid
filename conflict if someone tries to use git bisect.

jsoncpp library name changes to jsoncpp_lib_static.

jsoncpp version is the latest tagged release.
2018-06-14 21:20:46 +03:00
Pauli 424028a0ae jsoncpp: Fix (U)Int64 to long int on 64bit linux
Passing a 64bit integer to Json::Value fails to find matching. Even
tough long long int is also 64bits gcc considres long long int different
to long int. But fix can't be as simple as removing an long from type
because that would reduce 32bit builds to have only 32bit maximum int
size. But standard offers fixed width integer types that can be used to
get correct underlying type depending on platform.
2018-06-14 17:24:50 +03:00
Pauli 01abcb756e Request c++14 support from compilers
All platforms seems to either have compiler supporting c++14. Windows
already requires msvc2015 that supports c++14 which should make it
minimal issue to require c++14 support from all compilers because gcc
is pretty easy to upgrade.
2018-06-10 23:15:33 +03:00
Ben Lubar 9cf4cdbc1f
Simplify CMakeLists.txt for protobuf.
All of the compilers we support have std::unordered_map and std::unordered_set in their standard locations.
2018-05-13 16:55:38 -05:00
lethosor e2cd1fca58 Reorder dfhack-md5 GCC flags, fix another embark-assistant warning 2018-05-13 13:09:51 -04:00
lethosor 016dab3990 Fix more warnings, including stonesense 2018-05-12 22:10:07 -04:00
lethosor fcd8c9606e Fix some warnings on OS X 2018-05-12 18:46:58 -04:00
Ben Lubar afc2c476bb
Fix remaining warnings on Windows. 2018-04-06 21:22:48 -05:00
Ben Lubar 8a53ad543f
Fix clsocket warnings. 2018-04-05 14:46:02 -05:00
Ben Lubar 5d24aa8b62
Fix memset call in md5.cpp 2018-04-05 14:28:00 -05:00
Ben Lubar 1ec96aa992
Disable pointless warnings in protobuf-generated code. 2018-04-05 13:58:10 -05:00
Ben Lubar 7bbfd456d3
Fix compile errors on Ubuntu 18.04 Bionic Beaver 2018-03-08 11:42:58 -06:00
Ben Lubar ac1d6f947f
Update clsocket submodule. See DFHack/clsocket#10. 2017-07-21 10:24:00 -05:00
lethosor 01c6416824 Update submodules 2017-05-13 21:56:08 -04:00
lethosor 03f56f7315 gunzip.pl: use binary output mode
Fixes an issue with LF being turned into CRLF on Windows
2017-04-30 17:06:57 -04:00
lethosor 38702febf7 Use LUA_(C)PATH_VAR instead of LUA_(C)PATH in luaconf.h
This was apparently changed at some point around Lua 5.3, so a custom LUA_PATH
environment variable could prevent DFHack from initializing.
2017-03-14 00:24:05 -04:00
Ben Rosser 144675c74b Update bundled tinyxml version from 2.5.3 to 2.6.2
Upstream has moved onto tinyxml2, so this is likely to be the last
release of the original tinyxml (2.6.2 came out in 2011). dfhack
should therefore probably ship 2.6.2, since it's unlikely there will
ever be future fixes to this code. The upstream changelog (taken
from "changes.txt" in upstream tarball) contains many bugfixes and
is included in the commit message below.

2.5.4
- A TiXMLDocument can't be a sub-node. Block this from happening in
  the 'replace'. Thanks Noam.
- [ 1714831 ] TiXmlBase::location is not copied by copy-ctors, fix
  reported and suggested by Nicola Civran.
- Fixed possible memory overrun in the comment reading code - thanks
  gcarlton77

2.5.5
- Alex van der Wal spotted incorrect types (lf) being used in print
  and scan. robertnestor pointed out some problems with the simple
  solution. Types updated.
- Johannes Hillert pointed out some bug typos.
- Christian Mueller identified inconsistent error handling with
  Attributes.
- olivier barthelemy also reported a problem with double truncation,
  also related to the %lf issue.
- zaelsius came up with a great (and simple) suggestion to fix
  QueryValueAttribute truncating strings.
- added some null pointer checks suggested by hansenk
- Sami V�is�nen found a (rare) buffer overrun that could occur in
  parsing.
- vi tri filed a bug that led to a refactoring of the attribute
  setting mess (as well as adding a missing SetDoubleAttribute() )
- removed TIXML_ERROR_OUT_OF_MEMORY. TinyXML does not systematically
  address OOO, and the notion it does is misleading.
- vanneto, keithmarshall, others all reported the warning from
  IsWhiteSpace() usage. Cleaned this up - many thanks to everyone
  who reported this one.
- tibur found a bug in end tag parsing

2.6.2
- Switched over to VC 2010
- Fixed up all the build issues arising from that. (Lots of latent
  build problems.)
- Removed the old, now unmaintained and likely not working, build
  files.
- Fixed some static analysis issues reported by orbitcowboy from
  cppcheck.
- Bayard 95 sent in analysis from a different analyzer - fixes
  applied from that as well.
- Tim Kosse sent a patch fixing an infinite loop.
- Ma Anguo identified a doc issue.
- Eddie Cohen identified a missing qualifier resulting in a compilation
  error on some systems.
- Fixed a line ending bug. (What year is this? Can we all agree on a
  format for text files? Please? ...oh well.)
2016-12-06 21:40:30 -05:00
lethosor 04ad7a0a42 Replace some instances of "cmake -E copy_if_different" with a standalone script
@JapaMala reported that CMake < 3.5 doesn't support copy_if_different with
multiple source files.

https://cmake.org/cmake/help/v3.5/release/3.5.html#command-line
2016-11-02 16:23:32 -04:00
lethosor 7f7102f90c Distribute a gunzip.pl script
gunzip isn't reliably available on Windows, but IO::Uncompress::Gunzip should
be.

Suggested by Quietust.
2016-10-15 12:09:04 -04:00
lethosor ada96b3162 Remove GCC version check in protobuf/CMakeLists.txt
The only thing this check was used for was disabled, and the root CMakeLists.txt
will enforce the minimum GCC version before protobuf is included.
2016-10-10 09:33:52 -04:00
lethosor 1029e0f02a Fix a few whitespace issues
From #992
2016-09-15 01:37:07 -04:00
David Seguin 01a97f6487
Made pthread required for building protobuf 2016-09-08 17:12:42 -04:00
lethosor 18a8512242 Fix LLONG_MAX/LLONG_MIN in luaconf.h with old glibc versions 2016-08-13 11:40:30 -04:00
Lethosor 6e741b1a80 Merge pull request #969 from Qartar/win64
Minor fixes/updates for Visual Studio 2015 Win64
2016-08-10 15:15:44 -04:00
lethosor aa47484b2a Enable bit32 library
Deprecated in Lua 5.3, but still contains some useful things, like extract()

Also helps maintain backward-compatibility with scripts that target older DF
versions (e.g. Mifki's dfremote project)
2016-08-09 18:57:24 -04:00
Carter Bray 3b9d37abe5 Suppress integer conversion warnings inside protobuf source 2016-07-31 17:01:52 -07:00
lethosor 158f18106f Merge remote-tracking branch 'NCommander/vs2015' into develop 2016-07-29 15:30:32 -04:00
lethosor adff13f4ab Lua: re-enable C++ exceptions (re 42c620b) 2016-07-27 21:44:25 -04:00
lethosor 828fee532a Switch to downloading zlib.lib and SDLreal.dll on Windows 2016-07-27 21:08:24 -04:00
Vitaly Pronkin 8916aba3bf win64 fixes (partial)
cherry-picked from 2f734ae2317060edb83021f17cffc966c435ad7b
2016-07-27 19:46:49 -04:00
Vitaly Pronkin 4dd411e862 Update Lua config and patch checkdp 2016-07-26 23:29:26 -04:00
lethosor e2c6350978 Update Lua to 5.3.3 2016-07-26 23:23:26 -04:00
lethosor a684e1dd0f Merge remote-tracking branch 'lethosor/64-bit' into develop 2016-07-26 22:54:36 -04:00
Michael Casadevall e10397370b Merge branch 'develop' of github.com:DFHack/dfhack into vs2015 2016-07-11 18:59:22 -05:00
lethosor 2455e36510 Initial 64-bit support 2016-07-03 23:32:43 -04:00
Ben Rosser ae55d2d526 Support linking against an external tinyxml if EXTERNAL_TINYXML is set
As best as I can tell, the copy of tinyxml dfhack uses is unmodified
from whenever it was first bundled. This commit adds an option to CMake,
EXTERNAL_TINYXML, that if set to ON, will attempt to link against a system
tinyxml instead of using the dfhack-bundled one.  It defaults to OFF,
so there is no change in default behavior.

The DFHACK_TINYXML variable is then set to either "tinyxml" or "dfhack-tinyxml"
so the library (and any plugins that need updating) can link against one
or the other.

The FindTinyXML.cmake script was taken from https://github.com/ros/cmake_modules
(licensed under the 3-clause BSD license).

Add license text to new CMake file.
2016-06-29 17:53:16 -04:00
Michael Casadevall c3188b1d6c Make our build checks relate to the new compiler world order
(thanks lethosor)

Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-06-28 07:13:52 -05:00
Michael Casadevall 62e8740e3a Backport new hash.h from git upstream to add support for VS2015
Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-06-28 07:13:18 -05:00
lethosor f07bc03c69 Update clsocket and Open()/Listen() usage 2016-06-14 13:21:51 -04:00
lethosor a47a1c83ba Update xml, clsocket 2016-06-07 08:17:40 -04:00
Ben Lubar bfe7a90ec0 add NOMINMAX to Windows.h includes 2016-05-21 19:54:20 -05:00
Ben Lubar 700392ba55 Fix tinythread memory leak in two ways:
1. update to tinythread version 1.1, which provides a detach method
2. move the thread disassociation to the join function, which allows
attached threads to be joined even after they finish (this was the main
leak)

Also update RemoteServer.cpp to detach threads and delete the thread
objects instead of leaking them (although they are much smaller than the
actual threads).
2016-05-21 19:17:08 -05:00
lethosor 71ff6f875a Also exclude libprotoc when cross-compiling (unused) 2016-01-18 09:22:08 -05:00
lethosor e8ea5c93ca Build testHashMap.cpp in the build directory
This allows switching between build directories without having to re-run CMake
2016-01-09 08:37:01 -05:00
lethosor 8cec8af3b1 CMake: Support cross-compiling
This relies on a working cross-compiler, of course, as well as a separate build
directory for cross-compiled builds, with DFHACK_NATIVE_BUILD_DIR pointing
to an already-successful native build directory (this is needed for protoc).
2016-01-08 21:08:26 -05:00
lethosor 80556449a1 Improve Json::get() slightly 2015-11-27 16:45:26 -05:00
lethosor 485eddc54e JsonEx -> Json 2015-11-26 20:24:14 -05:00
lethosor e15dcfd72a protobuf: Disable unused-result warnings in release mode 2015-11-05 21:52:04 -05:00
lethosor 867b733a04 Fix a few GCC warnings on Linux (GCC 4.6) 2015-11-05 21:48:13 -05:00
lethosor f4a2188e42 Travis: Build DFHack 2015-10-03 15:58:41 -04:00
lethosor 0337df94de GCC: Specify C++11 when building protobuf
This is necessary to build with GCC 4.6 on Linux (Travis)
2015-10-03 15:40:28 -04:00
lethosor d71969fef9 Update clsocket 2015-10-03 13:55:16 -04:00
lethosor 45d095cbab Replace translate_socket_error() implementations with DescribeError() 2015-10-03 10:37:48 -04:00
lethosor 071f67f2aa Add some JSON helper functions 2015-07-29 20:09:55 -04:00
lethosor d02e67267a Replace jsonxx with jsoncpp 2015-07-29 15:50:33 -04:00
lethosor 527b17d964 Update submodules 2015-07-04 20:45:37 -04:00
lethosor 7c943179c7 Update clsocket 2015-04-30 19:22:53 -04:00
lethosor f3508f82c1 Add jsonxx to depends/ 2015-03-20 15:45:38 -04:00
lethosor 7abe70feb8 Update clsocket 2015-03-05 17:22:21 -05:00
lethosor 100fce0419 Update submodules 2015-02-21 23:06:15 -05:00
Japa 22edb5a033 Merge branch 'master' of https://github.com/DFHack/dfhack
Conflicts:
	library/xml
	plugins/isoworld
	plugins/rendermax/CMakeLists.txt
	plugins/rendermax/renderer_light.cpp
	plugins/rendermax/renderer_light.hpp
	plugins/rendermax/renderer_opengl.hpp
	plugins/rendermax/rendermax.cpp
	plugins/rendermax/rendermax.lua
2014-12-11 17:53:19 +05:30
Alexander "Ace" Olofsson d2039386b0 Add <algorithm> includes and use min/max to get them into global scope 2014-11-09 11:20:09 +01:00
Japa b74d0da872 Merge branch 'develop' of https://github.com/DFHack/dfhack
Conflicts:
	library/xml
2014-04-26 09:23:21 +05:30
Alexander Gavrilov 7ea8e25cd3 Rename the LUA_PATH/LUA_CPATH environment variables to avoid conflicts.
If a user has a standalone lua installation with these variables
configured, it should not confuse dfhack into looking for things
in wrong places.
2014-03-31 14:15:57 +04:00
Alexander Gavrilov a70fbf41d4 Reapply dfhack-specific lua build configuration. 2014-03-31 14:15:50 +04:00
Alexander Gavrilov 1132bea917 Update to Lua 5.2.3 2014-03-31 14:15:09 +04:00
Warmist 24d8a1f1c1 Added headers to tinythread cmake so that ide would show them. 2013-06-29 12:23:21 +03:00
Alexander Gavrilov 7224c8746a Print the new md5 hash after modification in binpatch. 2012-10-08 16:47:52 +04:00
Petr Mrázek 634c281f00 Track clsocket 2012-09-28 22:44:14 +02:00
Quietust 1325b70e41 Cleanup autolabor+cleanowned, fix depends/clsocket 2012-09-13 14:42:17 -05:00
Timothy Collett 96abc903ab Merge branch 'master' of http://github.com/peterix/dfhack 2012-09-10 11:54:56 -04:00
Timothy Collett 274d6038ad Merge further changes (???) 2012-09-10 09:19:21 -04:00
Timothy Collett 270351f510 Merge branch 'master' of https://github.com/danaris/dfhack 2012-09-10 09:18:24 -04:00
Petr Mrázek 509d957090 Make protobuf behave with multiple build folders involved. 2012-08-17 13:02:31 +02:00
Petr Mrázek 81ea0345ad Fix cage-related bug in the sort plugin. 2012-08-03 16:09:51 +02:00
Kelly Martin b2623e68a3 Track submodules 2012-07-11 14:38:04 -05:00
Timothy Collett 068542d58a Submodule changes 2012-07-05 11:39:08 -04:00
Timothy G Collett d5ae1fc4f2 Merge branch 'master' of https://github.com/danaris/dfhack
Conflicts:
	depends/clsocket
	package/darwin/dfhack
	package/darwin/dfhack-run
Fixed.
2012-06-24 18:41:24 -04:00
Timothy Collett 9b941bcd4d Merge branch 'master' of https://github.com/angavrilov/dfhack
Trying out angavrilov's changes
2012-06-18 09:29:20 -04:00
Alexander Gavrilov 16ae6cb1fb Fix lua bug: 'peaceful' unwind of yielded pcall doesn't restore errfunc.
I.e. if the pcall results in no error, but a yield happens inside it,
the active errfunc is not restored to its previous value.
2012-06-17 16:14:14 +04:00
Alexander Gavrilov eeaae916ed Reapply dfhack-specific lua build configuration. 2012-06-17 16:01:46 +04:00
Alexander Gavrilov 534367546d Update to Lua 5.2.1 2012-06-17 16:01:46 +04:00
Timothy Collett 12543d6a5b Make offsets with "darwin" os-type recognized as Apple, rather than ignored 2012-06-14 13:42:06 -04:00
Timothy G Collett 8f67139a75 fix clsocket? 2012-06-03 14:33:44 -04:00
Timothy G Collett 1e0ff32ad4 fix clsocket? 2012-06-03 11:01:13 -04:00
Quietust 08c302f3d1 Merge branch 'master' of https://github.com/peterix/dfhack 2012-05-30 07:52:56 -05:00
Petr Mrázek 0749233ed1 And again... 2012-05-30 01:12:29 +02:00
Petr Mrázek 246df43511 Track clsocket 2012-05-30 01:08:07 +02:00
Timothy Collett 44c3afc306 Merge git://github.com/quietust/dfhack
Gotta get the changes that prevent DFHack from crashing.
2012-05-24 15:39:11 -04:00
Timothy Collett 24d221052b Initial changes to get dfhack building on the Mac 2012-05-24 11:31:20 -04:00
Quietust 985533460c -Wno-sign-compare only works with GCC 2012-05-23 13:10:57 -05:00
Alexander Gavrilov 9c94b7c1e7 Make the hash map implementation error more useful.
It instructs to update GCC, but actually the most common
reason for the error is missing 32-bit development libs.
2012-04-28 11:53:26 +04:00
Alexander Gavrilov 0a6982f404 Enable warnings correctly on linux and fix a lot of them. 2012-04-20 13:30:37 +04:00
Alexander Gavrilov ee7100216e Fix lua interpreter bug: the C call counter is already unwound by yield.
Decrementing it causes underflow and subsequent spurious stack overflow.
2012-04-16 18:32:12 +04:00
Alexander Gavrilov d109b6570b Add dfhack.with_suspend(f[, args...]) that calls f with core suspended.
The lock is properly removed in case of error, which is then propagated.
Just for fun, it also can be yielded from within in a coroutine.
2012-04-01 19:38:42 +04:00
Alexander Gavrilov afe4eba957 Improve performance of the persistent data api, and wrap it for lua.
Use an stl table for string keys to avoid linear cost of lookup.

This uncovered a bug in the new luaL_getsubtable function.
2012-04-01 16:43:40 +04:00
Alexander Gavrilov 0f41608ed4 Pull console output support and REPL out of dfusion into core lib. 2012-03-31 15:40:54 +04:00
Alexander Gavrilov 9384f0c842 Update lua to 5.2 and fix obvious breakage due to obsolete api. 2012-03-31 12:11:43 +04:00
Alexander Gavrilov f6c6218909 Temporary tweak: patch in __pairs and __ipairs from 5.2 into lua 5.1. 2012-03-29 11:32:22 +04:00
Warmist 3761426ef5 Extern "C" mess fixed, bitlib mess fixed, bitlib added to autoload. 2012-03-26 18:48:24 +03:00
Alexander Gavrilov 5d471a2a74 Since lua is now compiled as c++, don't declare api functions extern "C". 2012-03-25 11:11:45 +04:00
Quietust e779a076fc Fix Lua compilation on win32 - extern must come BEFORE __declspec 2012-03-24 09:11:25 -05:00
Petr Mrázek 8a847dbaba Tweaks and cleanups
Removed t_virtual.
Made lua use C++ compiler
Removed many silly exception types from Error.h and renamed the rest.
Removed Brush classes from tiletypes plugin.
2012-03-24 12:13:51 +01:00
Alexander Gavrilov ccc8fac166 Get rid of the write mode field table in metamethods.
Two separate tables can be confusing, e.g. if a builtin field
overrides a writable custom one only in the read table.
2012-03-23 10:56:29 +04:00
Alexander Gavrilov dbbd9acfad Export the type tree with enum keys to lua. 2012-03-19 20:12:27 +04:00
Petr Mrázek badece1210 Fix problem with solution folders being generated for MSVC Express
Uses MFC header availability to detect Express versions.
2012-03-13 20:00:20 +01:00
Petr Mrázek 6dde2373d7 Make MSVC shut up when compiling protobuf.
Disabled planty of common harmless warnings.
2012-03-13 17:32:44 +01:00
Petr Mrázek 9079ffa4ff Add clsocket as a dependency for dfhack lib. 2012-03-13 17:10:46 +01:00
Petr Mrázek eb4757043b Move depends out of main library, make them (static) libraries. 2012-03-13 14:46:48 +01:00
Petr Mrázek bcbc540283 More moving of things 2010-04-02 17:27:35 +02:00
Petr Mrázek bb141fe8f6 Linux d18 ncurses support for shm lib
Some boost preparations
2010-02-23 19:26:15 +01:00