Commit Graph

4494 Commits

Author SHA1 Message Date
James Turner
5fdc756a64 Fix missing <cstdint> on non-Mac 2016-05-24 08:16:40 +01:00
James Turner
5b71d84a3a Merge /u/elgaton/simgear/ branch specify-standards-fixes into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/15/
2016-05-24 07:02:08 +00:00
Alessandro Menti
b1270376c9 Indentation fixes (and signed/unsigned comparison fix) to silence GCC 6 warnings 2016-05-24 00:11:22 +02:00
James Turner
871b418242 Initial Tar package support.
Needs proper testing, but basic unit-test passes.
2016-05-23 22:23:16 +01:00
Alessandro Menti
fd124e91de CMakeLists.txt: explicitly set the standard to C++98
Set the C++ standard to C++98 to avoid GCC 6 compilation failures.
2016-05-23 23:16:35 +02:00
Florent Rougon
5b71ede2ea Fix missing includes
When SimGear header files are included in a particular order, these
missing includes can cause the compilation to fail.
2016-05-23 12:24:37 +02:00
James Turner
6285a409ed Fix a crash with mismatch package versions. 2016-05-18 19:02:41 +01:00
James Turner
9818a123ca Fix removal of directories. 2016-05-18 10:50:57 +01:00
Automatic Release Builder
09ab029e2f new version: 2016.3.0 2016-05-17 10:03:44 +02:00
Automatic Release Builder
da2f365cd2 new version: 2016.2.1 2016-05-17 10:03:43 +02:00
Florent Rougon
496d458d22 Use _WIN32 instead of SG_WINDOWS for tests in simgear::strutils::error_string()
Since Cygwin has SG_WINDOWS defined but is likely to expose a POSIX or
GNU-like interface, using _WIN32 to decide whether Windows-specific
functions are available seems more appropriate than SG_WINDOWS to me.
2016-05-13 12:04:02 +02:00
James Turner
9dda5a4e31 Fix platform check for strerror_r on Mac 2016-05-10 20:47:25 +02:00
Florent Rougon
289daf0fbc Fix missing include in simgear/misc/strutils_test.cxx
strutils_test.cxx uses std::string but doesn't include <string>
directly. This doesn't cause any error because it includes this header
indirectly via "strutils.hxx". However, I believe relying on this is bad
practice, hence the tiny fix.
2016-05-09 16:37:09 +02:00
Florent Rougon
61e2d2dd3b Fix missing include in simgear/misc/strutils.cxx
Thanks to Alan Teeder for the report.
2016-05-09 16:03:37 +02:00
Torsten Dreyer
2523236cec Merge /u/frougon/flightgear-simgear/ branch thread-safe-alternative-to-strerror into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/9/
2016-05-09 10:51:13 +00:00
Torsten Dreyer
1c182ff69d Merge /u/psadro/simgear/ branch terragear-changes into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/8/
2016-05-09 10:47:04 +00:00
Florent Rougon
757970fe41 Thread-safe alternative to strerror()
Uses:
  - strerror_s() on Windows;
  - the GNU strerror_r() on non-Windows systems where _GNU_SOURCE is
    defined (which is currently the case when the GNU libstdc++ is used,
    even if one doesn't explicitely define _GNU_SOURCE, cf.
    <https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.predefined>);
  - the XSI-compliant strerror_r() on other systems, as long as
    _POSIX_C_SOURCE >= 200112L (otherwise, the compilation will abort
    due to a #error preprocessor instruction).
2016-05-08 23:28:01 +02:00
Peter Sadrozinski
6e904ba1aa add siblings function to bucket.
At some latitudes, buckets can have multiple siblings.
2016-05-07 07:43:22 -04:00
James Turner
616826ab69 Remove non-CURL HTTP option. 2016-05-07 10:11:40 +01:00
James Turner
6e4da15a58 Use SGBinaryFile in a couple more places.
Most importantly, when computing a hash from the on-disk
state.
2016-05-07 10:03:48 +01:00
Torsten Dreyer
561e451192 Introduce SGBinaryFile
For Windows, default file mode is TEXT.
If binary files should be created _O_BINARY shall be or'ed to the open
flags. This is not necessary on *nixes.

Introduce a SGBinaryFile as extension to SGFile which adds the flag
upon construction on Windows.

This should keep existing behaviour for all other usages of SGFile.
2016-05-06 22:01:42 +02:00
Torsten Dreyer
74b4df9452 Don't use object returned from vector::end()
Replace all use of c->name by it->file() in
updateChildrenBasedOnHash()'s fsChildren loop
to avoid confusion.

Thanks to Geoff for spotting this!
2016-05-06 16:21:43 +02:00
Torsten Dreyer
862980a67a Remove unneeded local scope
(no functional change intended)
2016-05-06 16:20:09 +02:00
Torsten Dreyer
5fb8891e86 Fix one more crash on Windows in HTTPRepository
inner scope it seems to overwrite out scope it on Win :-/

Anyway, the erase-remove-idiom is a better solution for that task
https://en.wikipedia.org/wiki/Erase%E2%80%93remove_idiom

Also remove some useless debug messages
2016-05-06 10:48:16 +02:00
Torsten Dreyer
f3d68a170e Don't continue parsing after processing version line 2016-05-05 21:59:35 +02:00
James Turner
1fe8931129 Packages: fix extract dir cleanup on success.
Don’t leave extract_xxxxxxx dirs in the Aircraft tree after successfully
extract the contents to the final location.
2016-05-04 22:22:34 +01:00
James Turner
d39b055ed1 Avoid unlink of an open file.
Works on Unix, not so great on Windows it turns out. Thanks to Jasin
and Geoff for figuring this out in the end.
2016-05-04 22:13:15 +01:00
Torsten Dreyer
639e16b722 use safer stl functions instead of pointer operations 2016-05-04 21:10:12 +02:00
Torsten Dreyer
9456ff838c Add a bunch of debug messages to help fixing the Windows crash
This patch should be reverted once the bug is fixed
2016-05-04 15:44:55 +02:00
Torsten Dreyer
eac3402176 Enable DNS resolver code by default 2016-05-03 14:58:38 +02:00
Torsten Dreyer
9a29f54f8a Terrasync: implement HTTP service lookup via DNS
Let terrasync use the http repository if
  /sim/terrasync/http-server == "automatic"
  resolve DNS NAPTR RR for terrasync.flightgear.org with service "ws20"
  and flags "U". Pick one of the returned entries with lowest order
  and preference. If more than one entry  with the same order and
  preference is returned, pick a random entry of those returned.

or if
  /sim/terrasync/http-server != "automatic"
  explicitly use the value of that property as the http server

if
  /sim/terrasync/http-server is empty, fall back to the legacy
  SVN repository
2016-05-03 12:11:38 +02:00
Torsten Dreyer
5e7b5cbf68 udns: fix self baked inet_pton 2016-05-03 09:43:56 +02:00
Torsten Dreyer
bba11c18d1 Fix Nasal math.clamp()
Thanks to "Red Leader" from the forum for spotting
2016-05-02 21:57:35 +02:00
Torsten Dreyer
379a171d24 Use simgear sleep instead of usleep 2016-05-02 21:25:19 +02:00
Torsten Dreyer
87eaec3ce7 Fix some warnings reported from msvc 2016-05-02 20:54:28 +02:00
Torsten Dreyer
b5dace5f08 Fix Windows build (hopefully) 2016-05-02 20:46:42 +02:00
Torsten Dreyer
5ecf07e92d udns: add missing config.h 2016-05-02 20:27:04 +02:00
Torsten Dreyer
53d8dcfc77 Try fix windows compile for udns 2016-05-02 17:42:01 +02:00
Torsten Dreyer
6b31646d61 Hardening the DNSClient code
- add a timeout to avoid deadlock without a dns server
- test against existing terrasync.flightgear.org RR's
2016-05-02 16:21:42 +02:00
Stuart Buchanan
06f888d38c Display random objects independently of buildings
Fix bug reported by Thorsten RENK on the mailing list
that random objects were only being displayed if random
objects were also present for the tile.  Also fix crash
if none of the random object models were found.
2016-05-01 22:35:21 +01:00
Torsten Dreyer
51ad61061f Fix broken build/install with DNS enabled 2016-04-28 10:50:15 +02:00
Torsten Dreyer
ff5b09c97b Initial commit for a DNS service resolver
- import udns library
  (http://www.corpit.ru/mjt/udns.html)
- initial draft for a DNSClient (derived from HTTPClient)

Enable compile and test by adding -D ENABLE_DNS=Yes to cmake flags
2016-04-28 09:37:08 +02:00
James Turner
46ed4b2f79 Catalog refresh / package updating test. 2016-04-20 11:58:35 +02:00
James Turner
8582676100 Catalog removal test
- verifies installed packages are removed also.
2016-04-19 13:56:07 +02:00
James Turner
32181a3956 Expand package-system unit-tests.
More to come, but this covers the absolute basics now.
2016-04-19 13:50:37 +02:00
James Turner
c17324b5ea Fixes for HTTP cancellation.
(Forgot to stage these from previous commit)
2016-04-14 09:42:04 +01:00
James Turner
a3f1bb546f HTTP request cancellation
- replaces abort() with something more structured.
2016-04-14 09:16:36 +01:00
Stuart Buchanan
493aab8bab Make LOD for buildings/trees/STG configurable.
Now based on /sim/rendering/static-lod/rough.
2016-04-08 22:36:06 +01:00
Richard Senior
92a51059b4 Fix problems parsing METAR strings that denote temporary sensor failures
1. Weather (normally blank, RA, SN, etc.) can be "//"
2. Cloud can be suffixed by "///", e.g. FEW045///

Also updated unit test.
2016-04-05 12:12:04 +01:00
James Turner
177c5ec709 Guard against disabling a not-yet-active catalog. 2016-03-30 17:09:51 +01:00