Clean up warnings: ‘tevent_loop_allow_nesting’ is deprecated
authorMartin Schwenke <martin@meltin.net>
Wed, 9 Nov 2011 03:41:17 +0000 (14:41 +1100)
committerMartin Schwenke <martin@meltin.net>
Wed, 9 Nov 2011 03:41:17 +0000 (14:41 +1100)
CTDB wants to use these functions but Samba's tevent wants to mark
them deprecated.  This adds a #define to shut up the warnings and sets
it in CFLAGS.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Makefile.in
lib/tevent/tevent.h

index 1f7128518c0f40f5452e2b954d95ed6c2e4d66ac..8f26456c0e616616be66e9500fe9442cd236d0ca 100755 (executable)
@@ -37,7 +37,7 @@ CFLAGS=-g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \
        -I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
        -DVARDIR=\"$(localstatedir)\" -DETCDIR=\"$(etcdir)\" \
        -DLOGDIR=\"$(logdir)\" \
-       -DUSE_MMAP=1 @CFLAGS@ $(POPT_CFLAGS)
+       -DUSE_MMAP=1 -DTEVENT_DEPRECATED_QUIET=1 @CFLAGS@ $(POPT_CFLAGS)
 
 LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) @INFINIBAND_LIBS@ @CTDB_PCAP_LDFLAGS@
 
index d3bf3666d5f12cb92ea41389354d837b942de2b3..914548fd6efc14ab8b47e918b9e1a6c3dbc05c50 100644 (file)
@@ -28,7 +28,9 @@
 #ifndef __TEVENT_H__
 #define __TEVENT_H__
 
+#ifndef TEVENT_DEPRECATED
 #define TEVENT_DEPRECATED
+#endif
 
 #include <stdint.h>
 #include <talloc.h>
@@ -1262,6 +1264,7 @@ typedef int (*tevent_nesting_hook)(struct tevent_context *ev,
                                   void *stack_ptr,
                                   const char *location);
 #ifdef TEVENT_DEPRECATED
+#if (TEVENT_DEPRECATED_QUIET != 1)
 #ifndef _DEPRECATED_
 #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
 #define _DEPRECATED_ __attribute__ ((deprecated))
@@ -1269,6 +1272,10 @@ typedef int (*tevent_nesting_hook)(struct tevent_context *ev,
 #define _DEPRECATED_
 #endif
 #endif
+#else
+#undef _DEPRECATED_
+#define _DEPRECATED_
+#endif
 void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
 void tevent_loop_set_nesting_hook(struct tevent_context *ev,
                                  tevent_nesting_hook hook,