Merge pull request #646 from hintjens/master

Mostly, tracking zproto's changes
Merge pull request #647 from hintjens/master

Problem: was trying to use ZMQ_STREAM on ZMQ v2/v3
Use _DEFAULT_SOURCE instead of _BSD_SOURCE

Since glibc 2.20, using _BSD_SOURCE triggers a warning, and since czmq
uses -Werror, it aborts the build:

  CC       zchunk.lo
In file included from /home/thomas/projets/buildroot/output/host/usr/nios2-buildroot-linux-gnu/sysroot/usr/include/ctype.h:25:0,
                 from ../include/czmq_prelude.h:203,
                 from ../include/czmq.h:19,
                 from zauth.c:25:
/home/thomas/projets/buildroot/output/host/usr/nios2-buildroot-linux-gnu/sysroot/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^

See the glibc 2.20 release notes, https://lwn.net/Articles/611162/,
explaining the change about _BSD_SOURCE:

* The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer
  supported; they now act the same as _DEFAULT_SOURCE (but generate a
  warning).  Except for cases where _BSD_SOURCE enabled BSD interfaces that
  conflicted with POSIX (support for which was removed in 2.19), the
  interfaces those macros enabled remain available when compiling with
  _GNU_SOURCE defined, with _DEFAULT_SOURCE defined, or without any feature
  test macros defined.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Merge pull request #648 from tpetazzoni/default-source-fix

Use _DEFAULT_SOURCE instead of _BSD_SOURCE
Merge pull request #649 from hintjens/master

Removed --with-libzmq-include-dir and -lib-dir (broken)
Merge pull request #650 from hintjens/master

Allow zdir to load top level only
Merge pull request #651 from hintjens/master

Problem: zsock_option.c:78 fails on MSVC
zhash: Add support for custom hash functions
zhash: Add support for destructor, duplicator and comparator for keys.
zlist: Add support for destructor and duplicator.
Merge pull request #652 from Q-Leap-Networks/pull-zhash-hasher

zhash: Add support for custom hash function and arbitrary key type
Problem: method names getting ugly and long

Adding depth for key management is a great idea. However it should
not make other aspects more complex. Most people do not need special
handlers for keys, so will never use these _set_key methods. So they
should not be paying the extra cost of using _item in the other
methods. Further, this leaks into other containers that don't use
keys at all.

Solution: keep the majority case methods short and sweet, use the
longer names for the rarer cases.

Also, consistency, zhash_set_key_hasher as it is for keys.
Problem: zlist autofree mechanism CANNOT be removed

The use of autofree is not identical with destructor/duplicator so
using these methods instead of the existing autofree code changes the
existing semantics of zlist_append and zlist_push. I'd already tried
and abandoned this change. If you need a list with this functionality
simply use zring.

Solution: reverted these changes.

Please: also do not use tabs on CZMQ source code.