netinet/ip.h requires netinet/in_systm.h

In Linux and other Unixes this is implicitly included, however in
some more exotic Unixes we need to explicitly include it.
(cherry picked from commit 2bdb35364e4308b0939cb957019edd2651cfbd3e)
Merge branch 'master' into 3.5.x
Update HACKING
(cherry picked from commit 9cac8346863dfbc95a4f37568b414b085c77caa2)
My ChangeLog entries.
(cherry picked from commit 2fe97fafc460043f1f77dbe7347305b941c89579)
s/CfOut/Log to fix compile error
(cherry picked from commit 7d60e40ce0cdb72b913aa57c7bc5f5059792d3c7)
Take alternative workdir into account in test.
Redmine #2573; correct mistake in placement of pragmas

The #pragma is not allowed inside functions, so move it outside.
Merge pull request #668 from cduclos/3.5.x

Cherry picking two changes to make 3.5 work again.
Wrong signature for mocked function

In logging_test.c we mock "sendto" to avoid sending data. In HPUX the compiler
is a little bit more strict than anticipated so it was complaining about the
type of the signature. It is interesting that this worked all over the place
and no other compiler complained even though it is evidently a failure.
(cherry picked from commit fbd070496208f87498558cf1bb71b4fddac3c892)
fix for redmine #2635
(cherry picked from commit 49018b38e52f81b0d0f3b663e32fcbcb6544ce23)
Aggregate changes from 3.5 pre-releases
(cherry picked from commit ac11043f9835051d711d628d253d8f402a6d05a0)
Bring master ChangeLog up to speed wrt 3.4 fixes
(cherry picked from commit 3e1dc941612f63d751ac499146fbeda77320e86d)
Using platform.h instead of system headers

This way all the logic for deciding which headers need to be called is
kept inside platform.h.
(cherry picked from commit 6ef867994d15dcdd2bbaba9142ed97772416c0ef)
Moar changes
(cherry picked from commit 1e4ed49ed8e01e275e7e4df9af84085bc0bf1d58)
More ChangeLog entries.
(cherry picked from commit 823ca5e648fb9c2db8cedc960085aee8a408ce30)
fixing a mem leak. Never free what you insert in a StringMap
(cherry picked from commit a38f6c683dc61c7cb07c32e3dee56630427d58e9)
Change configure test for getaddrinfo

The problem is that with the default AC_REPLACE_FUNCS, autoconf declares it as
"char getaddrinfo(void)". However on Windows, because of stdcall calling
convention, the symbol emitted differs because of the missing calling
convention directive and the different the number of arguments.

See http://lists.gnu.org/archive/html/autoconf/2013-05/msg00085.html for more
info.
(cherry picked from commit ca36b7634f432b45cc7bb22550a96606a2ac45a0)
Make the getaddrinfo check even simpler.

Amending the previous commit, this one removes completely the linking test for
getaddrinfo. So to replace the function, it is enough now for the platform to
be missing getaddrinfo declaration.
(cherry picked from commit 000f73915d9928981339e6b163173a5b26524e26)
Set of fixes to logging.
  - Fix setting debug level in options.
  - General standardization of logging
(cherry picked from commit 64d2b52c0e49cd70302ad8c53f27c41cab95b8b6)
Fix MinGW build for output review
(cherry picked from commit b271c85dd240ac03652625a04a8aa46e4df403fd)