From d5523ead90b6be2b07d4af745b8ed9b980a6b9f1 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 11 May 2011 13:23:13 -0700 Subject: Mark some structures in the library interface with visibility=default attribute. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As of gcc 4.6, there are new warnings from -Wattributes along the lines of: warning: ‘_notmuch_messages’ declared with greater visibility than the type of its field ‘_notmuch_messages::iterator’ [-Wattributes] To squelch these, we decorate all such containing structs with __attribute__((visibility("default"))). We take care to let only the C++ compiler see this, (since the C compiler would otherwise warn about ignored visibility attributes on types). --- lib/notmuch-private.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/notmuch-private.h') diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 0856751c..02e24ee8 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -81,6 +81,12 @@ _internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2); #define unused(x) x __attribute__ ((unused)) +#ifdef __cplusplus +# define visible __attribute__((visibility("default"))) +#else +# define visible +#endif + /* Thanks to Andrew Tridgell's (SAMBA's) talloc for this definition of * unlikely. The talloc source code comes to us via the GNU LGPL v. 3. */ @@ -405,7 +411,7 @@ typedef struct _notmuch_message_list { * somewhere with some nasty C++ objects in it. We'll try to maintain * ignorance of that here. (See notmuch_mset_messages_t in query.cc) */ -struct _notmuch_messages { +struct visible _notmuch_messages { notmuch_bool_t is_of_list_type; notmuch_message_node_t *iterator; }; -- cgit v1.2.3