aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-04-11 20:33:33 +0000
committerRoland Dreier <rolandd@cisco.com>2006-11-09 11:36:00 -0800
commita7a021117b1059ffa9c9df624e0b3f3eb37b111f (patch)
tree2d83c53315163f2ace93076ade7cf6f6bb5fb7f3
parent344246333077a4b411c242f01dfac203ccf9ec33 (diff)
downloadlibibverbs-a7a021117b1059ffa9c9df624e0b3f3eb37b111f.tar.gz
Add __attribute_const macro for gcc >= 3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--ChangeLog5
-rw-r--r--include/infiniband/verbs.h8
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 310c71b..d0db204 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-11 Roland Dreier <rdreier@cisco.com>
+
+ * include/infiniband/verbs.h: Add __attribute_const macro to
+ portably mark functions as __attribute__((const))
+
2006-03-28 Roland Dreier <rdreier@cisco.com>
* 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 */