From e270f5379bd794391e9a8f1be7f9aa17f0d7dd97 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 5 Jul 2013 11:48:09 -0400 Subject: Add gs_transfer_out_value() macro A simple macro to help with out parameters. --- libgsystem.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libgsystem.h b/libgsystem.h index c7aea6c..60884b6 100644 --- a/libgsystem.h +++ b/libgsystem.h @@ -25,6 +25,14 @@ G_BEGIN_DECLS +#define gs_transfer_out_value(outp, srcp) G_STMT_START { \ + if (outp) \ + { \ + *(outp) = *(srcp); \ + *(srcp) = NULL; \ + } \ + } G_STMT_END; + #include #include #include -- cgit v1.2.1