ZOOKEEPER-2905: Don't include `config.h` in `zookeeper.h`
In ZOOKEEPER-2841 I fixed the inclusion of project-specific porting code
that were included in the public headers, which then broke upstream
projects (in my case, Mesos).
Unfortunately, I inadvertently created a very similar problem, and it
wasn't evident until the build was coupled with another project with the
same bug. More specifically, when including ZooKeeper in Mesos, and
including Google's Glog in Mesos, both projects define the macros
`VERSION`, `PACKAGE_VERSION`, and `PACKAGE_TARNAME`, and do so publicly.
This is commonly defined in `config.h` by Autotools (and by CMake for
ZooKeeper for compatibility), and is not a problem unless included
publicly, such as in `zookeeper.h`, and by more than one project.
When refactoring, I saw two includes in `zookeeper.h` that instead of
being guarded by e.g. `#ifdef HAVE_SYS_SOCKET_H` were guarded by
`#ifndef WIN32`. I erroneously added `#include "config.h"` and guarded
the includes "properly" with a feature guard. However, configuration
files such as `config.h` and `winconfig.h` etc. must never be included
in publicly in `zookeeper.h`, for the reasons given above.
This patch reverts the bug, and instead includes `config.h` in
`zookeeper.c`, where it is not exposed to other projects.
Author: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
Reviewers: Patrick Hunt <phunt@apache.org>
Closes #383 from andschwa/ZOOKEEPER-2905-master
Change-Id: I7c94bbf9dd8a4bd0548fbf07cbb3ff1f0c3bbe06