Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prov/verbs: Replace __BITS_PER_LONG with LONG_WIDTH #10223

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions prov/verbs/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ AC_DEFUN([FI_VERBS_CONFIGURE],[

])

AC_CHECK_HEADERS([asm/types.h])

AS_IF([test $verbs_ibverbs_happy -eq 1 && \
test $verbs_rdmacm_happy -eq 1], [$1], [$2])

Expand Down
2 changes: 1 addition & 1 deletion prov/verbs/src/verbs_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ int vrb_query_atomic(struct fid_domain *domain_fid, enum fi_datatype datatype,
switch (datatype) {
case FI_INT64:
case FI_UINT64:
#if __BITS_PER_LONG == 64
#if LONG_WIDTH == 64
case FI_DOUBLE:
case FI_FLOAT:
#endif
Expand Down
17 changes: 16 additions & 1 deletion prov/verbs/src/verbs_ofi.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#include "config.h"

#include <asm/types.h>
#include <errno.h>
#include <fcntl.h>
#include <arpa/inet.h>
Expand Down Expand Up @@ -79,6 +78,22 @@

#include "ofi_verbs_compat.h"

/* define LONG_WIDTH used by atomics */
#include <limits.h>
#ifndef LONG_WIDTH
#ifdef LONG_BIT
#define LONG_WIDTH LONG_BIT
#elif defined(HAVE_ASM_TYPES_H)
#include <asm/types.h>
#define LONG_WIDTH __BITS_PER_LONG
#elif defined(__x86_64__) || defined(__aarch64__)
#ifndef __ILP32__
#define LONG_WIDTH 64
#else
#define LONG_WIDTH 32
#endif
#endif
#endif

#ifndef AF_IB
#define AF_IB 27
Expand Down
Loading