diff --git a/zookeeper-client/zookeeper-client-c/src/cli.c b/zookeeper-client/zookeeper-client-c/src/cli.c index 1864e564571..823ed72a5a0 100644 --- a/zookeeper-client/zookeeper-client-c/src/cli.c +++ b/zookeeper-client/zookeeper-client-c/src/cli.c @@ -948,6 +948,17 @@ int main(int argc, char **argv) { zoo_deterministic_conn_order(1); // enable deterministic order #ifdef HAVE_CYRUS_SASL_H + /* + * We need to disable the deprecation warnings as Apple has + * decided to deprecate all of CyrusSASL's functions with OS 10.11 + * (see MESOS-3030, ZOOKEEPER-4201). We are using GCC pragmas also + * for covering clang. + */ +#ifdef __APPLE__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + if (mechlist) { zoo_sasl_params_t sasl_params = { 0 }; int sr; @@ -977,6 +988,11 @@ int main(int argc, char **argv) { return errno; } } + +#ifdef __APPLE__ +#pragma GCC diagnostic pop +#endif + #endif /* HAVE_CYRUS_SASL_H */ if (!zh) { diff --git a/zookeeper-client/zookeeper-client-c/src/zk_sasl.c b/zookeeper-client/zookeeper-client-c/src/zk_sasl.c index e0ccfb31004..6ae7e123733 100644 --- a/zookeeper-client/zookeeper-client-c/src/zk_sasl.c +++ b/zookeeper-client/zookeeper-client-c/src/zk_sasl.c @@ -47,6 +47,17 @@ #include "zk_adaptor.h" #include "zookeeper_log.h" +/* + * We need to disable the deprecation warnings as Apple has decided to + * deprecate all of CyrusSASL's functions with OS 10.11 (see + * MESOS-3030, ZOOKEEPER-4201). We are using GCC pragmas also for + * covering clang. + */ +#ifdef __APPLE__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + /* * Store a duplicate of src, or NULL, into *target. Returns * ZSYSTEMERROR if no memory could be allocated, ZOK otherwise. @@ -539,3 +550,7 @@ sasl_callback_t *zoo_sasl_make_basic_callbacks(const char *user, return xcallbacks; } } + +#ifdef __APPLE__ +#pragma GCC diagnostic pop +#endif diff --git a/zookeeper-client/zookeeper-client-c/tests/LibCSymTable.h b/zookeeper-client/zookeeper-client-c/tests/LibCSymTable.h index 1b6f9db996d..08028abca8c 100644 --- a/zookeeper-client/zookeeper-client-c/tests/LibCSymTable.h +++ b/zookeeper-client/zookeeper-client-c/tests/LibCSymTable.h @@ -26,6 +26,7 @@ #include #include #include +#include #include // needed for _POSIX_MONOTONIC_CLOCK #ifdef THREADED diff --git a/zookeeper-client/zookeeper-client-c/tests/TestSASLAuth.cc b/zookeeper-client/zookeeper-client-c/tests/TestSASLAuth.cc index e6aa4cb3d50..c98d4bffc81 100644 --- a/zookeeper-client/zookeeper-client-c/tests/TestSASLAuth.cc +++ b/zookeeper-client/zookeeper-client-c/tests/TestSASLAuth.cc @@ -130,6 +130,16 @@ class Zookeeper_SASLAuth : public CPPUNIT_NS::TestFixture { } #ifdef HAVE_CYRUS_SASL_H + + // We need to disable the deprecation warnings as Apple has + // decided to deprecate all of CyrusSASL's functions with OS 10.11 + // (see MESOS-3030, ZOOKEEPER-4201). We are using GCC pragmas also + // for covering clang. +#ifdef __APPLE__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + void testClientSASLHelper(const char *hostPorts, const char *path) { startServer(); @@ -260,6 +270,10 @@ class Zookeeper_SASLAuth : public CPPUNIT_NS::TestFixture { stopServer(); } +#ifdef __APPLE__ +#pragma GCC diagnostic pop +#endif + #endif /* HAVE_CYRUS_SASL_H */ };