emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thoughts on replacing macros with static inline functions


From: Po Lu
Subject: Re: Thoughts on replacing macros with static inline functions
Date: Fri, 18 Nov 2022 14:27:09 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

xenodasein--- via "Emacs development discussions." <emacs-devel@gnu.org>
writes:

> Why do you not consider __attribute__((always_inline)) an improvement
> over macros where applicable?

And exactly where is __attribute__((always_inline)) present?  Only on
GCC, right?  What about Sun C, and other C99 compilers?

And how is an additional function an improvement over extremely trivial
macros, like these:

#define XM_DRAG_REASON(originator, code)        ((code) | ((originator) << 7))
#define XM_DRAG_REASON_ORIGINATOR(reason)       (((reason) & 0x80) ? 1 : 0)
#define XM_DRAG_REASON_CODE(reason)             ((reason) & 0x7f)

?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]