# HG changeset patch # User John Bailey # Date 1190004624 0 # Node ID 3a5f152e7ed09983d61735d734ecc4ac6a8995c7 # Parent ac6bf49cd5ba99558ed250832170ebd1290e1446 This fixes compilation issues where old glib and either an old gcc or a non-gcc compiler is used. I have opted to put the same preprocessor directives in each plugin over including additional headers to fix this for the purposes of staying as close as possible to the version I have in the how-to documentss on the wiki. Fixes #3142 and bugs reported via the mailing list, IRC channel, and XMPP conference. diff -r ac6bf49cd5ba -r 3a5f152e7ed0 libpurple/plugins/debug_example.c --- a/libpurple/plugins/debug_example.c Mon Sep 17 04:29:46 2007 +0000 +++ b/libpurple/plugins/debug_example.c Mon Sep 17 04:50:24 2007 +0000 @@ -27,6 +27,16 @@ /* We're including glib.h again for the gboolean type. */ #include +/* This will prevent compiler errors in some instances and is better explained in the + * how-to documents on the wiki */ +#ifndef G_GNUC_NULL_TERMINATED +# if __GNUC__ >= 4 +# define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) +# else +# define G_GNUC_NULL_TERMINATED +# endif +#endif + /* This is the required definition of PURPLE_PLUGINS as required for a plugin, * but we protect it with an #ifndef because config.h may define it for us * already and this would cause an unneeded compiler warning. */ diff -r ac6bf49cd5ba -r 3a5f152e7ed0 libpurple/plugins/helloworld.c --- a/libpurple/plugins/helloworld.c Mon Sep 17 04:29:46 2007 +0000 +++ b/libpurple/plugins/helloworld.c Mon Sep 17 04:50:24 2007 +0000 @@ -33,6 +33,16 @@ #include +/* This will prevent compiler errors in some instances and is better explained in the + * how-to documents on the wiki */ +#ifndef G_GNUC_NULL_TERMINATED +# if __GNUC__ >= 4 +# define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) +# else +# define G_GNUC_NULL_TERMINATED +# endif +#endif + #include #include #include diff -r ac6bf49cd5ba -r 3a5f152e7ed0 libpurple/plugins/notify_example.c --- a/libpurple/plugins/notify_example.c Mon Sep 17 04:29:46 2007 +0000 +++ b/libpurple/plugins/notify_example.c Mon Sep 17 04:50:24 2007 +0000 @@ -26,6 +26,16 @@ #include +/* This will prevent compiler errors in some instances and is better explained in the + * how-to documents on the wiki */ +#ifndef G_GNUC_NULL_TERMINATED +# if __GNUC__ >= 4 +# define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) +# else +# define G_GNUC_NULL_TERMINATED +# endif +#endif + /* This is the required definition of PURPLE_PLUGINS as required for a plugin, * but we protect it with an #ifndef because config.h may define it for us * already and this would cause an unneeded compiler warning. */