From 0da1bbdc0bde0133a1d1e855957f8ea6dced421e Mon Sep 17 00:00:00 2001 From: David Mandelin Date: Thu, 24 Apr 2008 15:05:06 -0700 Subject: [PATCH] Bug 422555: outparam and inoutparam attributes --- xpcom/base/nscore.h | 8 ++++++-- xpcom/typelib/xpidl/xpidl_header.c | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h index 98c4689df30e..878fdf1163d9 100644 --- a/xpcom/base/nscore.h +++ b/xpcom/base/nscore.h @@ -258,10 +258,14 @@ /** * Attributes defined to help Dehydra GCC analysis. */ -#ifdef DEHYDRA_GCC -# define NS_SCRIPTABLE __attribute__((user("script"))) +#ifdef STATIC_CHECKING +# define NS_SCRIPTABLE __attribute__((user("NS_script"))) +# define NS_OUTPARAM __attribute__((user("NS_outparam"))) +# define NS_INOUTPARAM __attribute__((user("NS_inoutparam"))) #else # define NS_SCRIPTABLE +# define NS_OUTPARAM +# define NS_INOUTPARAM #endif /** diff --git a/xpcom/typelib/xpidl/xpidl_header.c b/xpcom/typelib/xpidl/xpidl_header.c index d9b8fdcc28a3..c4da8076a01a 100644 --- a/xpcom/typelib/xpidl/xpidl_header.c +++ b/xpcom/typelib/xpidl/xpidl_header.c @@ -998,6 +998,12 @@ write_param(IDL_tree param_tree, FILE *outfile) fputs(IDL_IDENT(IDL_PARAM_DCL(param_tree).simple_declarator).str, outfile); + if (IDL_PARAM_DCL(param_tree).attr == IDL_PARAM_OUT) { + fputs(" NS_OUTPARAM", outfile); + } else if (IDL_PARAM_DCL(param_tree).attr == IDL_PARAM_INOUT) { + fputs(" NS_INOUTPARAM", outfile); + } + return TRUE; }