[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: __attribute__ ((cleanup)) and emacs-module.c
From: |
Paul Eggert |
Subject: |
Re: __attribute__ ((cleanup)) and emacs-module.c |
Date: |
Sat, 11 Mar 2023 13:21:16 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 2023-03-10 17:37, Po Lu wrote:
+#define MODULE_INTERNAL_CLEANUP \
+ module_reset_handlerlist (&internal_cleanup)
No need for the "&" here. Omit it, and change the type of
module_reset_handlerlist to take 'struct handler *' instead of 'struct
handler **'.
Also, please make this macro a parameterless function-style macro called
via 'MODULE_INTERNAL_CLEANUP ()' as it acts like a function.
Also, please define a macro MODULE_FUNCTION_END something like this:
#define MODULE_FUNCTION_END(retval) \
(MODULE_INTERNAL_CLEANUP (), retval)
and use 'return MODULE_FUNCTION_END (<simple-expression>);' when the
cleanup is immediately followed by a return of a value of a simple
expression. For complex expressions that can throw exceptions, you can
use something like:
<type> r = <complex-expression>;
return MODULE_FUNCTION_END (r);
- Re: Merging feature/android, (continued)
- Re: Merging feature/android, Eli Zaretskii, 2023/03/08
- Re: Merging feature/android, Po Lu, 2023/03/08
- Re: Merging feature/android, Eli Zaretskii, 2023/03/09
- Re: Merging feature/android, Po Lu, 2023/03/09
- Re: Merging feature/android, Eli Zaretskii, 2023/03/09
- __attribute__ ((cleanup)) and emacs-module.c, Po Lu, 2023/03/09
- Re: __attribute__ ((cleanup)) and emacs-module.c, Philipp Stephani, 2023/03/09
- Re: __attribute__ ((cleanup)) and emacs-module.c, Po Lu, 2023/03/09
- Re: __attribute__ ((cleanup)) and emacs-module.c, Paul Eggert, 2023/03/10
- Re: __attribute__ ((cleanup)) and emacs-module.c, Po Lu, 2023/03/10
- Re: __attribute__ ((cleanup)) and emacs-module.c,
Paul Eggert <=
- Re: __attribute__ ((cleanup)) and emacs-module.c, Po Lu, 2023/03/11
- Re: __attribute__ ((cleanup)) and emacs-module.c, Paul Eggert, 2023/03/11
- Re: Merging feature/android, Eli Zaretskii, 2023/03/08
- Re: Merging feature/android, Arsen Arsenović, 2023/03/06
- Re: Merging feature/android, Po Lu, 2023/03/06
- Re: Merging feature/android, Arsen Arsenović, 2023/03/06
- Re: Merging feature/android, Po Lu, 2023/03/06
- Re: Merging feature/android, Eli Zaretskii, 2023/03/05
- Re: Merging feature/android, Po Lu, 2023/03/05
- Re: Merging feature/android, Richard Stallman, 2023/03/04