1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

include/ruby/internal/stdalign.h: add doxygen

Unlike other "add doxygen" commits this one adds a preprocessor branch
that doxygen would process.  This prevents it from parsing other parts
of the file.
This commit is contained in:
卜部昌平 2021-01-18 19:57:48 +09:00
parent 73d2bf97c1
commit 818fabfcd9
Notes: git 2021-09-10 20:01:53 +09:00

View file

@ -83,7 +83,9 @@
* @see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69560 * @see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69560
* @see https://bugs.llvm.org/show_bug.cgi?id=26547 * @see https://bugs.llvm.org/show_bug.cgi?id=26547
*/ */
#if defined(__cplusplus) #if defined(__DOXYGEN__)
# define RBIMPL_ALIGNOF alignof
#elif defined(__cplusplus)
# /* C++11 `alignof()` can be buggy. */ # /* C++11 `alignof()` can be buggy. */
# /* see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69560 */ # /* see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69560 */
# /* But don't worry, we can use templates. */ # /* But don't worry, we can use templates. */
@ -117,7 +119,7 @@ struct rbimpl_alignof {
# * There are 2 known pitfalls for this fallback implementation: # * There are 2 known pitfalls for this fallback implementation:
# * # *
# * First, it is either an undefined behaviour (C) or an explicit error (C++) # * First, it is either an undefined behaviour (C) or an explicit error (C++)
# * to define a struct inside of `offsetof`. C compilers tend to accept such # * to define a struct inside of `offsetof`. C compilers tend to accept such
# * things, but AFAIK C++ has no room to allow. # * things, but AFAIK C++ has no room to allow.
# * # *
# * Second, there exist T such that `struct { char _; T t; }` is invalid. A # * Second, there exist T such that `struct { char _; T t; }` is invalid. A