compiler: Provide LIBPLDM_CC_UNUSED
Ensure that we have __has_attribute available, and then further
ensure that the unused attribute is provided. Once satisfied, define
LIBPDLM_CC_UNUSED and replace raw use of __attribute__((unused)).
Change-Id: I2433039297d5fdedb8b8d99b30e73e4542d9069f
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/transport/transport.c b/src/transport/transport.c
index 33197ab..24c264a 100644
--- a/src/transport/transport.c
+++ b/src/transport/transport.c
@@ -1,4 +1,5 @@
/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
+#include "compiler.h"
#include "transport.h"
#include <libpldm/transport.h>
@@ -23,9 +24,9 @@
short revents; /* returned events */
};
-static inline int poll(struct pollfd *fds __attribute__((unused)),
- int nfds __attribute__((unused)),
- int timeout __attribute__((unused)))
+static inline int poll(struct pollfd *fds LIBPLDM_CC_UNUSED,
+ int nfds LIBPLDM_CC_UNUSED,
+ int timeout LIBPLDM_CC_UNUSED)
{
return 0;
}