summaryrefslogtreecommitdiff
path: root/usr/src/tools/ctf/common/ctf_headers.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/tools/ctf/common/ctf_headers.h')
-rw-r--r--usr/src/tools/ctf/common/ctf_headers.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/src/tools/ctf/common/ctf_headers.h b/usr/src/tools/ctf/common/ctf_headers.h
index 7cad0d2a27..572fb03d4d 100644
--- a/usr/src/tools/ctf/common/ctf_headers.h
+++ b/usr/src/tools/ctf/common/ctf_headers.h
@@ -64,12 +64,12 @@
* when <sys/ctf_api.h> is included via a nested #include rather than
* an explicit path #include.
*
- * Finally, to make life easier, we also include the current definitions of the
- * ccompile.h and sysmacros.h headers to make it so we have to rely less on the
- * build system contents.
+ * We'll also include the local ccompile.h - older build systems often lack
+ * useful definitions like __unused. Finally, we'll also define ARRAY_SIZE:
+ * unfortunately, older systems sysmacros.h only have this defined for the
+ * kernel, and we can't easily pick it up otherwise.
*/
-#include <uts/common/sys/sysmacros.h>
#include <uts/common/sys/ccompile.h>
#include <uts/common/sys/ctf.h>
#include <uts/common/sys/ctf_api.h>
@@ -77,4 +77,8 @@
#include <lib/libctf/common/libctf.h>
#include <lib/libctf/common/libctf_impl.h>
+#if !defined(ARRAY_SIZE)
+#define ARRAY_SIZE(x) (sizeof (x) / sizeof (x[0]))
+#endif
+
#endif /* _CTF_HEADERS_H */