]> git.notmuchmail.org Git - notmuch/commitdiff
Mark some structures in the library interface with visibility=default attribute.
authorCarl Worth <cworth@cworth.org>
Wed, 11 May 2011 20:23:13 +0000 (13:23 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 11 May 2011 20:27:15 +0000 (13:27 -0700)
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/message.cc
lib/notmuch-private.h
lib/query.cc
lib/thread.cc

index a5a65e21701b49530ac755ab4be6e6e9d3acae72..4b59fa9133f9cc45227bc8fbb63e0baeb3f7e7f3 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <gmime/gmime.h>
 
-struct _notmuch_message {
+struct visible _notmuch_message {
     notmuch_database_t *notmuch;
     Xapian::docid doc_id;
     int frozen;
index 0856751c318841b08eeab0d1035ea6393cb8da7b..02e24ee8eb20d9c763c14d25454f86ad741a8133 100644 (file)
@@ -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;
 };
index 07e695b950aeddb3f11b875639f498da1db4d871..6f02b04b95dc81def0c240a055b95ea7917153b8 100644 (file)
@@ -44,7 +44,7 @@ struct _notmuch_doc_id_set {
 #define DOCIDSET_WORD(bit) ((bit) / sizeof (unsigned int))
 #define DOCIDSET_BIT(bit) ((bit) % sizeof (unsigned int))
 
-struct _notmuch_threads {
+struct visible _notmuch_threads {
     notmuch_query_t *query;
 
     /* The ordered list of doc ids matched by the query. */
index ace5ce7fd178fbde7358982bacb7c20034a378d2..0435ee6d1f3a62d24098b8f100bd6356ec2562ea 100644 (file)
@@ -24,7 +24,7 @@
 #include <gmime/gmime.h>
 #include <glib.h> /* GHashTable */
 
-struct _notmuch_thread {
+struct visible _notmuch_thread {
     notmuch_database_t *notmuch;
     char *thread_id;
     char *subject;