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)
Add function categories

This is for output in cf-promises --syntax-description for automatic categorization
of functions for documentation.
(cherry picked from 120243c36f2178409fcec818524b945a0670f66d)
Rename ScopeDeleteSpecialScalar -> ScopeDeleteSpecial
(cherry picked from c7e9c076240428e346e0c58207fec45007a7b789)
Remove ScopeNewScalar, convert to EvalContextVariablePut
(cherry picked from 88bb130bc5130fd9314f13a355c09af974291ccb)
Remove ScopeNewList, convert to EvalContextVariablePut
(cherry picked from a6b1e1ecfacf6ad149d57bd9b77875e4215a7f6c)
Combine ScopeNewSpecialScalar, ScopeNewSpecialList -> ScopeNewSpecial
(cherry-picked from a6bbc43383db0da0a9638ae6ababe8ce8161b24b)
Squashed commit of the following:

commit 5880c565888195490663b89a2b4b7b56d0495ad1
Author: Volker Hilsheimer <volker.hilsheimer@cfengine.com>
Date:   Wed May 22 19:03:44 2013 +0200

    Don't register a thread-ID callback on Windows.

    pthread_t on MinGW32 is a struct, and long is not large enough to hold the void*
    within.

    OpenSSL documentation states: If the application does not register such a callback
    using CRYPTO_THREADID_set_callback(), then a default implementation is used - on
    Windows and BeOS this uses the system's default thread identifying APIs

    So not setting this callback at all will be safe.

commit 32408d29c3d87576446f5d12523fbe2fcd26da12
Author: Volker Hilsheimer <volker.hilsheimer@cfengine.com>
Date:   Wed May 22 17:12:26 2013 +0200

    Compile on systems where alternative API is avaiable

commit 1f7beb743656c0d11f0b0b0880b2dd3f1ee03d76
Author: Volker Hilsheimer <volker.hilsheimer@cfengine.com>
Date:   Tue May 21 08:04:26 2013 +0200

    With OpenSSL initialized to be made thread-safe, we don't have to serialize
    access to the OpenSSL functions anymore.

    Some other things were protected here by the cft_system locking:

    - the ServerConnectionState *conn

    This structure is initialized in the main thread, and then passed to the
    thread handler, which takes exclusive ownership. No access to this object
    from other threads is possible or allowed.

    - malloc calls

    Those are implicily threadsafe on all supported platforms today

    Conflicts:

    	src/cf-serverd.c

commit 3cc7c617b0f035a107101bc511126086befde5a5
Author: Volker Hilsheimer <volker.hilsheimer@cfengine.com>
Date:   Tue May 21 07:55:14 2013 +0200

    Initialize OpenSSL with callback functions for threadlocking.

    This makes OpenSSL threadsafe, and allows us to remove locking around the
    calls to the RSA encryption functions in cf-serverd's AuthenticationDialogue.
    Implements #2678

    Note: the functions used - as well as most other functions used from
    OpenSSL - are marked as deprecated on Mac OSX 10.7 and later.
    Compiler warnings explicitly disabled. Functions documented in OpenSSL
    documentation (http://www.openssl.org/docs/crypto/threads.html) to replace
    some of these functions (such as CRYPTO_THREADID_set_callback) are not
    available. This implementation follows the example provided on
    http://www.opensource.apple.com/source/OpenSSL/OpenSSL-10/openssl/crypto/threads/mttest.c

    Conflicts:

    	src/crypto.c
    	src/generic_agent.c

commit 80d71ade7999c12c31902f7baa1513bd7d3e3ddb
Author: Volker Hilsheimer <volker.hilsheimer@cfengine.com>
Date:   Tue May 21 07:43:26 2013 +0200

    Silence deprecated warnings when compiling on Mac OSX.

    Majority of functions in /usr/include/openssl/crypto.h are marked as
    deprecated for Mac OSX 10.7 and later. Silence warnings.

    Conflicts:

    	src/crypto.c
(cherry picked from commit 84b98866aee85637552558845d1646f210dd9cdd)
Merge pull request #691 from sigurdteigen/35x

Cherry picks - Merging so that master and 3.5.x don't unnecessarily diverge.
Merge branch '3.5.x' of git://github.com/cfengine/core into memFixes-3.5.x

Conflicts:
	libpromises/expand.c