# HG changeset patch
# Node ID 397b29d917c7
# Parent  22c6e2dc94bd
diff --git a/libpurple/protocols/ircv3/meson.build b/libpurple/protocols/ircv3/meson.build
--- a/libpurple/protocols/ircv3/meson.build
+++ b/libpurple/protocols/ircv3/meson.build
@@ -58,6 +58,7 @@ install_headers(IRCV3_HEADERS,
 
 ircv3_prpl = shared_library('ircv3', IRCV3_SOURCES + IRCV3_HEADERS + [ircv3_h],
 	c_args : ['-DPURPLE_IRCV3_COMPILATION', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-IRCv3"'],
+	gnu_symbol_visibility : 'hidden',
 	dependencies : [libpurple_dep, glib, gio, hasl, ws2_32],
 	install : true,
 	install_dir : PURPLE_PLUGINDIR)
diff --git a/libpurple/protocols/ircv3/purpleircv3capabilities.h b/libpurple/protocols/ircv3/purpleircv3capabilities.h
--- a/libpurple/protocols/ircv3/purpleircv3capabilities.h
+++ b/libpurple/protocols/ircv3/purpleircv3capabilities.h
@@ -31,6 +31,8 @@
 
 #include <purple.h>
 
+#include "purpleircv3version.h"
+
 G_BEGIN_DECLS
 
 /* https://ircv3.net/specs/extensions/capability-negotiation */
@@ -75,6 +77,7 @@ G_GNUC_INTERNAL gboolean purple_ircv3_ca
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 PurpleIRCv3Connection *purple_ircv3_capabilities_get_connection(PurpleIRCv3Capabilities *capabilities);
 
 /**
@@ -88,6 +91,7 @@ PurpleIRCv3Connection *purple_ircv3_capa
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_capabilities_request(PurpleIRCv3Capabilities *capabilities, const char *capability);
 
 /**
@@ -104,6 +108,7 @@ void purple_ircv3_capabilities_request(P
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 const char *purple_ircv3_capabilities_lookup(PurpleIRCv3Capabilities *capabilities, const char *name, gboolean *found);
 
 /**
@@ -124,6 +129,7 @@ const char *purple_ircv3_capabilities_lo
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 gboolean purple_ircv3_capabilities_lookup_and_request(PurpleIRCv3Capabilities *capabilities, const char *name);
 
 /**
@@ -136,6 +142,7 @@ gboolean purple_ircv3_capabilities_looku
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_capabilities_add_wait(PurpleIRCv3Capabilities *capabilities);
 
 /**
@@ -150,6 +157,7 @@ void purple_ircv3_capabilities_add_wait(
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_capabilities_remove_wait(PurpleIRCv3Capabilities *capabilities);
 
 G_END_DECLS
diff --git a/libpurple/protocols/ircv3/purpleircv3connection.h b/libpurple/protocols/ircv3/purpleircv3connection.h
--- a/libpurple/protocols/ircv3/purpleircv3connection.h
+++ b/libpurple/protocols/ircv3/purpleircv3connection.h
@@ -31,6 +31,8 @@
 
 #include <purple.h>
 
+#include "purpleircv3version.h"
+
 G_BEGIN_DECLS
 
 #define PURPLE_IRCV3_TYPE_CONNECTION (purple_ircv3_connection_get_type())
@@ -103,6 +105,7 @@ PurpleIRCv3Capabilities *purple_ircv3_co
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 gboolean purple_ircv3_connection_get_registered(PurpleIRCv3Connection *connection);
 
 /**
@@ -114,6 +117,7 @@ gboolean purple_ircv3_connection_get_reg
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_connection_add_status_message(PurpleIRCv3Connection *connection, PurpleIRCv3Message *message);
 
 G_END_DECLS
diff --git a/libpurple/protocols/ircv3/purpleircv3message.h b/libpurple/protocols/ircv3/purpleircv3message.h
--- a/libpurple/protocols/ircv3/purpleircv3message.h
+++ b/libpurple/protocols/ircv3/purpleircv3message.h
@@ -30,9 +30,13 @@
 
 #include <purple.h>
 
+#include "purpleircv3version.h"
+
 G_BEGIN_DECLS
 
 #define PURPLE_IRCV3_TYPE_MESSAGE (purple_ircv3_message_get_type())
+
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE(PurpleIRCv3Message, purple_ircv3_message, PURPLE_IRCV3,
                      MESSAGE, GObject)
 
@@ -46,6 +50,7 @@ G_DECLARE_FINAL_TYPE(PurpleIRCv3Message,
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 PurpleIRCv3Message *purple_ircv3_message_new(const char *command);
 
 /**
@@ -58,6 +63,7 @@ PurpleIRCv3Message *purple_ircv3_message
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 const char *purple_ircv3_message_get_command(PurpleIRCv3Message *message);
 
 /**
@@ -69,6 +75,7 @@ const char *purple_ircv3_message_get_com
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_message_set_command(PurpleIRCv3Message *message, const char *command);
 
 /**
@@ -81,6 +88,7 @@ void purple_ircv3_message_set_command(Pu
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 GStrv purple_ircv3_message_get_params(PurpleIRCv3Message *message);
 
 /**
@@ -92,6 +100,7 @@ GStrv purple_ircv3_message_get_params(Pu
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_message_set_params(PurpleIRCv3Message *message, GStrv params);
 
 /**
@@ -104,6 +113,7 @@ void purple_ircv3_message_set_params(Pur
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 const char *purple_ircv3_message_get_source(PurpleIRCv3Message *message);
 
 /**
@@ -115,6 +125,7 @@ const char *purple_ircv3_message_get_sou
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_message_set_source(PurpleIRCv3Message *message, const char *source);
 
 /**
@@ -128,6 +139,7 @@ void purple_ircv3_message_set_source(Pur
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 GHashTable *purple_ircv3_message_get_tags(PurpleIRCv3Message *message);
 
 /**
@@ -139,6 +151,7 @@ GHashTable *purple_ircv3_message_get_tag
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_message_set_tags(PurpleIRCv3Message *message, GHashTable *tags);
 
 G_END_DECLS
diff --git a/libpurple/protocols/ircv3/purpleircv3messagehandlers.h b/libpurple/protocols/ircv3/purpleircv3messagehandlers.h
--- a/libpurple/protocols/ircv3/purpleircv3messagehandlers.h
+++ b/libpurple/protocols/ircv3/purpleircv3messagehandlers.h
@@ -28,6 +28,7 @@
 #include <purple.h>
 
 #include "purpleircv3message.h"
+#include "purpleircv3version.h"
 
 G_BEGIN_DECLS
 
@@ -44,6 +45,7 @@ G_BEGIN_DECLS
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_TYPE_IN_3_0
 typedef gboolean (*PurpleIRCv3MessageHandler)(PurpleIRCv3Message *message,
                                               GError **error,
                                               gpointer data);
diff --git a/libpurple/protocols/ircv3/purpleircv3parser.h b/libpurple/protocols/ircv3/purpleircv3parser.h
--- a/libpurple/protocols/ircv3/purpleircv3parser.h
+++ b/libpurple/protocols/ircv3/purpleircv3parser.h
@@ -29,10 +29,13 @@
 #include <purple.h>
 
 #include "purpleircv3messagehandlers.h"
+#include "purpleircv3version.h"
 
 G_BEGIN_DECLS
 
 #define PURPLE_IRCV3_TYPE_PARSER (purple_ircv3_parser_get_type())
+
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE(PurpleIRCv3Parser, purple_ircv3_parser, PURPLE_IRCV3,
                      PARSER, GObject)
 
@@ -43,6 +46,7 @@ G_DECLARE_FINAL_TYPE(PurpleIRCv3Parser, 
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 PurpleIRCv3Parser *purple_ircv3_parser_new(void);
 
 /**
@@ -55,6 +59,7 @@ PurpleIRCv3Parser *purple_ircv3_parser_n
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_parser_set_fallback_handler(PurpleIRCv3Parser *parser, PurpleIRCv3MessageHandler handler);
 
 /**
@@ -70,6 +75,7 @@ void purple_ircv3_parser_set_fallback_ha
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 gboolean purple_ircv3_parser_parse(PurpleIRCv3Parser *parser, const gchar *buffer, GError **error, gpointer data);
 
 /**
@@ -82,6 +88,7 @@ gboolean purple_ircv3_parser_parse(Purpl
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_parser_add_handler(PurpleIRCv3Parser *parser, const char *command, PurpleIRCv3MessageHandler handler);
 
 /**
@@ -95,6 +102,7 @@ void purple_ircv3_parser_add_handler(Pur
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_parser_add_handlers(PurpleIRCv3Parser *parser, PurpleIRCv3MessageHandler handler, ...) G_GNUC_NULL_TERMINATED;
 
 /**
@@ -105,6 +113,7 @@ void purple_ircv3_parser_add_handlers(Pu
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_parser_add_default_handlers(PurpleIRCv3Parser *parser);
 
 G_END_DECLS
diff --git a/libpurple/protocols/ircv3/purpleircv3source.h b/libpurple/protocols/ircv3/purpleircv3source.h
--- a/libpurple/protocols/ircv3/purpleircv3source.h
+++ b/libpurple/protocols/ircv3/purpleircv3source.h
@@ -26,6 +26,8 @@
 #include <glib.h>
 #include <glib-object.h>
 
+#include "purpleircv3version.h"
+
 G_BEGIN_DECLS
 
 /**
@@ -43,6 +45,7 @@ G_BEGIN_DECLS
  *
  * Since: 3.0.0
  */
+PURPLE_IRCV3_AVAILABLE_IN_ALL
 void purple_ircv3_source_parse(const char *source, char **nick, char **user, char **host);
 
 G_END_DECLS
diff --git a/libpurple/protocols/ircv3/purpleircv3version.h b/libpurple/protocols/ircv3/purpleircv3version.h
new file mode 100644
--- /dev/null
+++ b/libpurple/protocols/ircv3/purpleircv3version.h
@@ -0,0 +1,128 @@
+/*
+ * Purple - Internet Messaging Library
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+#if !defined(PURPLE_IRCV3_GLOBAL_HEADER_INSIDE) && \
+    !defined(PURPLE_IRCV3_COMPILATION)
+# error "only <libpurple/protocols/ircv3.h> may be included directly"
+#endif
+
+#ifndef PURPLE_IRCV3_VERSION_H
+#define PURPLE_IRCV3_VERSION_H
+
+#include <glib.h>
+
+#include <purple.h>
+
+#if (defined(_WIN32) || defined(__CYGWIN__)) && \
+	!defined(PURPLE_IRCV3_STATIC_COMPILATION)
+#define _PURPLE_IRCV3_EXPORT __declspec(dllexport)
+#define _PURPLE_IRCV3_IMPORT __declspec(dllimport)
+#elif __GNUC__ >= 4
+#define _PURPLE_IRCV3_EXPORT __attribute__((visibility("default")))
+#define _PURPLE_IRCV3_IMPORT
+#else
+#define _PURPLE_IRCV3_EXPORT
+#define _PURPLE_IRCV3_IMPORT
+#endif
+#ifdef PURPLE_IRCV3_COMPILATION
+#define _PURPLE_IRCV3_API _PURPLE_IRCV3_EXPORT
+#else
+#define _PURPLE_IRCV3_API _PURPLE_IRCV3_IMPORT
+#endif
+
+#define _PURPLE_IRCV3_EXTERN _PURPLE_IRCV3_API extern
+
+#ifdef PURPLE_IRCV3_DISABLE_DEPRECATION_WARNINGS
+#define PURPLE_IRCV3_DEPRECATED _PURPLE_IRCV3_EXTERN
+#define PURPLE_IRCV3_DEPRECATED_FOR(f) _PURPLE_IRCV3_EXTERN
+#define PURPLE_IRCV3_UNAVAILABLE(maj, min) _PURPLE_IRCV3_EXTERN
+#define PURPLE_IRCV3_UNAVAILABLE_STATIC_INLINE(maj, min)
+#define PURPLE_IRCV3_UNAVAILABLE_TYPE(maj, min)
+#else
+#define PURPLE_IRCV3_DEPRECATED G_DEPRECATED _PURPLE_IRCV3_EXTERN
+#define PURPLE_IRCV3_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _PURPLE_IRCV3_EXTERN
+#define PURPLE_IRCV3_UNAVAILABLE(maj, min) G_UNAVAILABLE(maj, min) _PURPLE_IRCV3_EXTERN
+#define PURPLE_IRCV3_UNAVAILABLE_STATIC_INLINE(maj, min) G_UNAVAILABLE(maj, min)
+#define PURPLE_IRCV3_UNAVAILABLE_TYPE(maj, min) G_UNAVAILABLE(maj, min)
+#endif
+
+/**
+ * PURPLE_IRCV3_VERSION_CUR_STABLE:
+ *
+ * A macro that evaluates to the current stable version of the IRCv3 protocol
+ * plugin, in a format that can be used by the C pre-processor.
+ *
+ * Since: 3.0.0
+ */
+#define PURPLE_IRCV3_VERSION_CUR_STABLE \
+	(G_ENCODE_VERSION(PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION))
+
+/* If the package sets PURPLE_IRCV3_VERSION_MIN_REQUIRED to some future
+ * PURPLE_IRCV3_VERSION_X_Y value that we don't know about, it will compare as 0 in
+ * preprocessor tests.
+ */
+#ifndef PURPLE_IRCV3_VERSION_MIN_REQUIRED
+#define PURPLE_IRCV3_VERSION_MIN_REQUIRED (PURPLE_IRCV3_VERSION_CUR_STABLE)
+#elif PURPLE_IRCV3_VERSION_MIN_REQUIRED == 0
+#undef PURPLE_IRCV3_VERSION_MIN_REQUIRED
+#define PURPLE_IRCV3_VERSION_MIN_REQUIRED (PURPLE_IRCV3_VERSION_CUR_STABLE + 1)
+#endif /* PURPLE_IRCV3_VERSION_MIN_REQUIRED */
+
+#if !defined(PURPLE_IRCV3_VERSION_MAX_ALLOWED) || (PURPLE_IRCV3_VERSION_MAX_ALLOWED == 0)
+#undef PURPLE_IRCV3_VERSION_MAX_ALLOWED
+#define PURPLE_IRCV3_VERSION_MAX_ALLOWED (PURPLE_IRCV3_VERSION_CUR_STABLE)
+#endif /* PURPLE_IRCV3_VERSION_MAX_ALLOWED */
+
+/* sanity checks */
+#if PURPLE_IRCV3_VERSION_MIN_REQUIRED > PURPLE_IRCV3_VERSION_CUR_STABLE
+#error "PURPLE_IRCV3_VERSION_MIN_REQUIRED must be <= PURPLE_IRCV3_VERSION_CUR_STABLE"
+#endif
+#if PURPLE_IRCV3_VERSION_MAX_ALLOWED < PURPLE_IRCV3_VERSION_MIN_REQUIRED
+#error "PURPLE_IRCV3_VERSION_MAX_ALLOWED must be >= PURPLE_IRCV3_VERSION_MIN_REQUIRED"
+#endif
+#if PURPLE_IRCV3_VERSION_MIN_REQUIRED < G_ENCODE_VERSION(3, 0)
+#error "PURPLE_IRCV3_VERSION_MIN_REQUIRED must be >= PURPLE_IRCV3_VERSION_3_0"
+#endif
+
+#define PURPLE_IRCV3_VAR _PURPLE_IRCV3_EXTERN
+#define PURPLE_IRCV3_AVAILABLE_IN_ALL _PURPLE_IRCV3_EXTERN
+
+/**
+ * PURPLE_IRCV3_VERSION_3_0:
+ *
+ * A macro that evaluates to the 3.0 version of the IRCv3 protocol plugin, in a
+ * format that can be used by the C pre-processor.
+ *
+ * Since: 3.0.0
+ */
+#define PURPLE_IRCV3_VERSION_3_0 (G_ENCODE_VERSION(3, 0))
+
+#if PURPLE_IRCV3_VERSION_MAX_ALLOWED < PURPLE_IRCV3_VERSION_3_0
+#define PURPLE_IRCV3_AVAILABLE_IN_3_0 PURPLE_IRCV3_UNAVAILABLE(3, 0)
+#define PURPLE_IRCV3_AVAILABLE_STATIC_INLINE_IN_3_0 PURPLE_IRCV3_UNAVAILABLE_STATIC_INLINE(3, 0)
+#define PURPLE_IRCV3_AVAILABLE_MACRO_IN_3_0 PURPLE_IRCV3_UNAVAILABLE_MACRO(3, 0)
+#define PURPLE_IRCV3_AVAILABLE_ENUMERATOR_IN_3_0 PURPLE_IRCV3_UNAVAILABLE_ENUMERATOR(3, 0)
+#define PURPLE_IRCV3_AVAILABLE_TYPE_IN_3_0 PURPLE_IRCV3_UNAVAILABLE_TYPE(3, 0)
+#else
+#define PURPLE_IRCV3_AVAILABLE_IN_3_0 _PURPLE_IRCV3_EXTERN
+#define PURPLE_IRCV3_AVAILABLE_STATIC_INLINE_IN_3_0
+#define PURPLE_IRCV3_AVAILABLE_MACRO_IN_3_0
+#define PURPLE_IRCV3_AVAILABLE_ENUMERATOR_IN_3_0
+#define PURPLE_IRCV3_AVAILABLE_TYPE_IN_3_0
+#endif
+
+#endif /* PURPLE_IRCV3_VERSION_H */
