Skip to content

Commit

Permalink
fix(tree): use decltype instead of typeof for cxx
Browse files Browse the repository at this point in the history
stack-info: PR: aws#565, branch: aws-nslick/stack/12
Signed-off-by: Nicholas Sielicki <[email protected]>
  • Loading branch information
aws-nslick committed Sep 25, 2024
1 parent e566ff8 commit b471b06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/nccl_ofi_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ extern "C" {
* @param a
* Must be a power of two
*/
#ifndef __cplusplus
#define NCCL_OFI_IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
#else
#define NCCL_OFI_IS_ALIGNED(x, a) (((x) & ((decltype(x))(a) - 1)) == 0)
#endif

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

0 comments on commit b471b06

Please sign in to comment.