----------------------------------------------------------------- Revision: 936cdaa27fea9a9673ee31a184af0a30d9471abe Ancestor: f4700a52b60d8473e9671ceabfec7772211fe424 Author: rekkanoryo@cpw.pidgin.im Date: 2007-09-17T04:50:24 Branch: im.pidgin.pidgin Modified files: libpurple/plugins/debug_example.c libpurple/plugins/helloworld.c libpurple/plugins/notify_example.c ChangeLog: 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. ============================================================ --- libpurple/plugins/debug_example.c 953105da0c7e250ada9b795a8bea786fa88e3051 +++ libpurple/plugins/debug_example.c 81ac161b529b13c7778509f04fb3ba4ad670e4ab @@ -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. */ ============================================================ --- libpurple/plugins/helloworld.c 3510130a72f33acbedfbaa4b9bd157894777d00b +++ libpurple/plugins/helloworld.c dad7a3244fac95c5602df892ea2f962a8d07af3c @@ -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 ============================================================ --- libpurple/plugins/notify_example.c f329a392aa6aaa90b09bd2d1cadbf6402d42936d +++ libpurple/plugins/notify_example.c ebc510bd5b8bbba3538112c470bec014fbb49675 @@ -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. */