Skip to content

Commit

Permalink
fix(tree): use __typeof__ instead of typeof (aws#565)
Browse files Browse the repository at this point in the history
typeof stopped working in newer GCC when in cxx mode. __typeof__ works
in all cases and is the preferred solution for doing this portably.

Signed-off-by: Nicholas Sielicki <[email protected]>
  • Loading branch information
aws-nslick committed Sep 30, 2024
1 parent ad885d5 commit b4702c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/nccl_ofi_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern "C" {
* @param a
* Must be a power of two
*/
#define NCCL_OFI_IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
#define NCCL_OFI_IS_ALIGNED(x, a) (((x) & ((__typeof__(x))(a) - 1)) == 0)

/*
* @brief Return true if and only if pointer `p` is `a`-byte aligned
Expand Down

0 comments on commit b4702c5

Please sign in to comment.