changeset 12419:455610a80747

[gaim-migrate @ 14726] Avoid nested extern warnings. This is probably as clean as the prototyping can get on perl, unless someone can get the XS stuff to generated .h files as well. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 08 Dec 2005 21:08:15 +0000
parents a4229dd9c76a
children b7d77321b685
files plugins/perl/common/Gaim.xs plugins/perl/perl-common.h
diffstat 2 files changed, 68 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/perl/common/Gaim.xs	Thu Dec 08 21:07:24 2005 +0000
+++ b/plugins/perl/common/Gaim.xs	Thu Dec 08 21:08:15 2005 +0000
@@ -2,11 +2,75 @@
 #include "../perl-handlers.h"
 #include "const-c.inc"
 
+/* Prototypes for the BOOT section below. */
+GAIM_PERL_BOOT_PROTO(Account);
+GAIM_PERL_BOOT_PROTO(Account__Option);
+GAIM_PERL_BOOT_PROTO(Buddy__Icon);
+GAIM_PERL_BOOT_PROTO(BuddyList);
+GAIM_PERL_BOOT_PROTO(Cipher);
+GAIM_PERL_BOOT_PROTO(Cmds);
+GAIM_PERL_BOOT_PROTO(Connection);
+GAIM_PERL_BOOT_PROTO(Conversation);
+GAIM_PERL_BOOT_PROTO(Xfer);
+GAIM_PERL_BOOT_PROTO(ImgStore);
+GAIM_PERL_BOOT_PROTO(Log);
+GAIM_PERL_BOOT_PROTO(Network);
+GAIM_PERL_BOOT_PROTO(Notify);
+GAIM_PERL_BOOT_PROTO(Plugin);
+GAIM_PERL_BOOT_PROTO(PluginPref);
+GAIM_PERL_BOOT_PROTO(Pounce);
+GAIM_PERL_BOOT_PROTO(Prefs);
+GAIM_PERL_BOOT_PROTO(Privacy);
+GAIM_PERL_BOOT_PROTO(Proxy);
+GAIM_PERL_BOOT_PROTO(Prpl);
+GAIM_PERL_BOOT_PROTO(Request);
+GAIM_PERL_BOOT_PROTO(Roomlist);
+GAIM_PERL_BOOT_PROTO(SSL);
+GAIM_PERL_BOOT_PROTO(SavedStatus);
+GAIM_PERL_BOOT_PROTO(Sound);
+GAIM_PERL_BOOT_PROTO(Status);
+GAIM_PERL_BOOT_PROTO(Stringref);
+GAIM_PERL_BOOT_PROTO(Util);
+GAIM_PERL_BOOT_PROTO(XMLNode);
+
+
 MODULE = Gaim  PACKAGE = Gaim  PREFIX = gaim_
 PROTOTYPES: ENABLE
 
 INCLUDE: const-xs.inc
 
+BOOT:
+	GAIM_PERL_BOOT(Account);
+	GAIM_PERL_BOOT(Account__Option); 
+	GAIM_PERL_BOOT(Buddy__Icon);
+	GAIM_PERL_BOOT(BuddyList);
+	GAIM_PERL_BOOT(Cipher);
+	GAIM_PERL_BOOT(Cmds);
+	GAIM_PERL_BOOT(Connection);
+	GAIM_PERL_BOOT(Conversation);
+	GAIM_PERL_BOOT(Xfer);
+	GAIM_PERL_BOOT(ImgStore);
+	GAIM_PERL_BOOT(Log);
+	GAIM_PERL_BOOT(Network);
+	GAIM_PERL_BOOT(Notify);
+	GAIM_PERL_BOOT(Plugin);
+	GAIM_PERL_BOOT(PluginPref); 
+	GAIM_PERL_BOOT(Pounce);
+	GAIM_PERL_BOOT(Prefs);
+	GAIM_PERL_BOOT(Privacy);
+	GAIM_PERL_BOOT(Proxy);
+	GAIM_PERL_BOOT(Prpl);
+	GAIM_PERL_BOOT(Request);
+	GAIM_PERL_BOOT(Roomlist);
+	GAIM_PERL_BOOT(SSL);
+	GAIM_PERL_BOOT(SavedStatus);
+	GAIM_PERL_BOOT(Sound);
+	GAIM_PERL_BOOT(Status);
+	GAIM_PERL_BOOT(Stringref);
+	GAIM_PERL_BOOT(Util);
+	GAIM_PERL_BOOT(XMLNode); 
+
+
 void
 timeout_add(plugin, seconds, callback, data = 0)
 	Gaim::Plugin plugin
@@ -80,34 +144,3 @@
 CODE:
 	gaim_perl_timeout_clear();
 
-
-BOOT:
-	GAIM_PERL_BOOT(Account);
-	GAIM_PERL_BOOT(Account__Option); 
-	GAIM_PERL_BOOT(Buddy__Icon);
-	GAIM_PERL_BOOT(BuddyList);
-	GAIM_PERL_BOOT(Cipher);
-	GAIM_PERL_BOOT(Cmds);
-	GAIM_PERL_BOOT(Connection);
-	GAIM_PERL_BOOT(Conversation);
-	GAIM_PERL_BOOT(Xfer);
-	GAIM_PERL_BOOT(ImgStore);
-	GAIM_PERL_BOOT(Log);
-	GAIM_PERL_BOOT(Network);
-	GAIM_PERL_BOOT(Notify);
-	GAIM_PERL_BOOT(Plugin);
-	GAIM_PERL_BOOT(PluginPref);
-	GAIM_PERL_BOOT(Pounce);
-	GAIM_PERL_BOOT(Prefs);
-	GAIM_PERL_BOOT(Privacy);
-	GAIM_PERL_BOOT(Proxy);
-	GAIM_PERL_BOOT(Prpl);
-	GAIM_PERL_BOOT(Request);
-	GAIM_PERL_BOOT(Roomlist);
-	GAIM_PERL_BOOT(SSL);
-	GAIM_PERL_BOOT(SavedStatus);
-	GAIM_PERL_BOOT(Sound);
-	GAIM_PERL_BOOT(Status);
-	GAIM_PERL_BOOT(Stringref);
-	GAIM_PERL_BOOT(Util);
-	GAIM_PERL_BOOT(XMLNode); 
--- a/plugins/perl/perl-common.h	Thu Dec 08 21:07:24 2005 +0000
+++ b/plugins/perl/perl-common.h	Thu Dec 08 21:08:15 2005 +0000
@@ -17,11 +17,11 @@
 #define hvref(o) \
 	(is_hvref(o) ? (HV *)SvRV(o) : NULL);
 
+#define GAIM_PERL_BOOT_PROTO(x) \
+	extern void boot_Gaim__##x(pTHX_ CV *cv);
+
 #define GAIM_PERL_BOOT(x) \
-	{ \
-		extern void boot_Gaim__##x(pTHX_ CV *cv); \
-		gaim_perl_callXS(boot_Gaim__##x, cv, mark); \
-	}
+	gaim_perl_callXS(boot_Gaim__##x, cv, mark)
 
 void gaim_perl_normalize_script_name(char *name);