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.
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.
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).
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.
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
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.
- 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