From: Roland Dreier Date: Tue, 11 Apr 2006 20:33:33 +0000 (+0000) Subject: Add __attribute_const macro for gcc >= 3 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a7a021117b1059ffa9c9df624e0b3f3eb37b111f;p=~shefty%2Flibibverbs.git Add __attribute_const macro for gcc >= 3 Signed-off-by: Roland Dreier --- diff --git a/ChangeLog b/ChangeLog index 310c71b..d0db204 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-11 Roland Dreier + + * include/infiniband/verbs.h: Add __attribute_const macro to + portably mark functions as __attribute__((const)) + 2006-03-28 Roland Dreier * src/init.c (load_driver): Print warning if dlopen() of a driver diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index ccea54c..b8ff8a7 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -51,6 +51,12 @@ # define END_C_DECLS #endif /* __cplusplus */ +#if __GNUC__ >= 3 +# define __attribute_const __attribute__((const)) +#else +# define __attribute_const +#endif + BEGIN_C_DECLS union ibv_gid { @@ -949,4 +955,6 @@ int ibv_detach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid); END_C_DECLS +# undef __attribute_const + #endif /* INFINIBAND_VERBS_H */