# HG changeset patch
# Node ID 207638a05c91
# Parent  685d01c0126e
diff --git a/libpurple/protocols/jabber/auth_digest_md5.h b/libpurple/protocols/jabber/auth_digest_md5.h
--- a/libpurple/protocols/jabber/auth_digest_md5.h
+++ b/libpurple/protocols/jabber/auth_digest_md5.h
@@ -25,6 +25,8 @@
 #ifndef PURPLE_JABBER_AUTH_DIGEST_MD5_H
 #define PURPLE_JABBER_AUTH_DIGEST_MD5_H
 
+#include "jabber.h"
+
 /*
  * Every function in this file is ONLY exposed for tests.
  * DO NOT USE ANYTHING HERE OR YOU WILL BE SENT TO THE PIT OF DESPAIR.
@@ -33,6 +35,7 @@
 /*
  * Parse a DIGEST-MD5 challenge.
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 GHashTable *jabber_auth_digest_md5_parse(const char *challenge);
 
 #endif /* PURPLE_JABBER_AUTH_DIGEST_MD5_H */
diff --git a/libpurple/protocols/jabber/auth_scram.h b/libpurple/protocols/jabber/auth_scram.h
--- a/libpurple/protocols/jabber/auth_scram.h
+++ b/libpurple/protocols/jabber/auth_scram.h
@@ -65,6 +65,7 @@ typedef struct {
  *          NOT null-terminated and its length is the length of the binary
  *          output of the hash function in-use.
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 guchar *jabber_scram_hi(const JabberScramHash *hash, const GString *str,
                         GString *salt, guint iterations);
 
@@ -79,17 +80,20 @@ guchar *jabber_scram_hi(const JabberScra
  *
  * @returns TRUE if the proofs were successfully calculated. FALSE otherwise.
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 gboolean jabber_scram_calc_proofs(JabberScramData *data, GString *salt,
                                   guint iterations);
 
 /**
  * Feed the algorithm with the data from the server.
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 gboolean jabber_scram_feed_parser(JabberScramData *data, gchar *in, gchar **out);
 
 /**
  * Clean up and destroy the data struct
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 void jabber_scram_data_destroy(JabberScramData *data);
 
 #endif /* PURPLE_JABBER_AUTH_SCRAM_H */
diff --git a/libpurple/protocols/jabber/caps.h b/libpurple/protocols/jabber/caps.h
--- a/libpurple/protocols/jabber/caps.h
+++ b/libpurple/protocols/jabber/caps.h
@@ -68,6 +68,7 @@ void jabber_caps_get_info(JabberStream *
  *	@param hash_type GChecksumType to be used. Either sha-1 or md5.
  *	@return		The base64 encoded SHA-1 hash; must be freed by caller
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 gchar *jabber_caps_calculate_hash(JabberCapsClientInfo *info,
                                   GChecksumType hash_type);
 
@@ -95,6 +96,7 @@ void jabber_caps_broadcast_change(void);
  * @param query The 'query' element from an IQ reply stanza.
  * @returns A JabberCapsClientInfo struct, or NULL on error
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 JabberCapsClientInfo *jabber_caps_parse_client_info(PurpleXmlNode *query);
 
 /**
@@ -105,6 +107,7 @@ JabberCapsClientInfo *jabber_caps_parse_
  *
  * @param info The info object to free.
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 void jabber_caps_client_info_destroy(JabberCapsClientInfo *info);
 
 #endif /* PURPLE_JABBER_CAPS_H */
diff --git a/libpurple/protocols/jabber/jabber.h b/libpurple/protocols/jabber/jabber.h
--- a/libpurple/protocols/jabber/jabber.h
+++ b/libpurple/protocols/jabber/jabber.h
@@ -59,6 +59,12 @@ typedef struct _JabberStream JabberStrea
 
 #include <purple.h>
 
+#ifdef PURPLE_XMPP_COMPILATION
+#define PURPLE_XMPP_EXTERN_FOR_TESTS _PURPLE_EXPORT extern
+#else
+#define PURPLE_XMPP_EXTERN_FOR_TESTS _PURPLE_IMPORT extern
+#endif
+
 #include "namespaces.h"
 
 #include "auth.h"
diff --git a/libpurple/protocols/jabber/jutil.h b/libpurple/protocols/jabber/jutil.h
--- a/libpurple/protocols/jabber/jutil.h
+++ b/libpurple/protocols/jabber/jutil.h
@@ -44,6 +44,7 @@ typedef enum {
 
 #include "jabber.h"
 
+PURPLE_XMPP_EXTERN_FOR_TESTS
 JabberID* jabber_id_new(const char *str);
 
 /**
@@ -52,20 +53,25 @@ JabberID* jabber_id_new(const char *str)
  */
 gboolean jabber_id_equal(const JabberID *jid1, const JabberID *jid2);
 
+PURPLE_XMPP_EXTERN_FOR_TESTS
 void jabber_id_free(JabberID *jid);
 
+PURPLE_XMPP_EXTERN_FOR_TESTS
 char *jabber_get_resource(const char *jid);
+PURPLE_XMPP_EXTERN_FOR_TESTS
 char *jabber_get_bare_jid(const char *jid);
 char *jabber_id_get_bare_jid(const JabberID *jid);
 char *jabber_id_get_full_jid(const JabberID *jid);
 
 gboolean jabber_jid_is_domain(const char *jid);
 
+PURPLE_XMPP_EXTERN_FOR_TESTS
 const char *jabber_normalize(const PurpleAccount *account, const char *in);
 
 /* Returns true if JID is the bare JID of our account. */
 gboolean jabber_is_own_account(JabberStream *js, const char *jid);
 
+PURPLE_XMPP_EXTERN_FOR_TESTS
 gboolean jabber_nodeprep_validate(const char *);
 gboolean jabber_domain_validate(const char *);
 gboolean jabber_resourceprep_validate(const char *);
@@ -77,6 +83,7 @@ gboolean jabber_resourceprep_validate(co
  *          of the input, or NULL if an error occurred (the string could
  *          not be normalized)
  */
+PURPLE_XMPP_EXTERN_FOR_TESTS
 char *jabber_saslprep(const char *);
 
 /* state -> readable name */
diff --git a/libpurple/protocols/jabber/meson.build b/libpurple/protocols/jabber/meson.build
--- a/libpurple/protocols/jabber/meson.build
+++ b/libpurple/protocols/jabber/meson.build
@@ -90,7 +90,7 @@ if DYNAMIC_JABBER
 	JABBER_SOURCES += xmpp_resources
 
 	jabber_prpl = shared_library('jabber', JABBER_SOURCES,
-	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-XMPP"'],
+	    c_args : ['-DPURPLE_XMPP_COMPILATION', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-XMPP"'],
 	    link_args : jabber_link_args,
 	    dependencies : [gstreamer, idn, libxml, libpurple_dep, libsoup, glib, gio, math, ws2_32],
 	    install : true,
