summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/ccompile.h
diff options
context:
space:
mode:
authorDan McDonald <danmcd@mnx.io>2022-05-13 17:20:24 -0400
committerGitHub <noreply@github.com>2022-05-13 17:20:24 -0400
commitbb7d6c9b47695f41cbacbcf6662baf3d0e152fdf (patch)
tree75f2d0cab5fb92f97f2ab2c3186a0b5d1579a33a /usr/src/uts/common/sys/ccompile.h
parent8ca5534c77e93c25d2c1f777499b12da0f7cc0cd (diff)
parent402559e299331588f209b3a9693e3bcd6a83d22c (diff)
downloadillumos-joyent-OS-8149.tar.gz
Merge branch 'master' into OS-8149OS-8149
Diffstat (limited to 'usr/src/uts/common/sys/ccompile.h')
-rw-r--r--usr/src/uts/common/sys/ccompile.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/ccompile.h b/usr/src/uts/common/sys/ccompile.h
index de0031d6b0..94f7c9707b 100644
--- a/usr/src/uts/common/sys/ccompile.h
+++ b/usr/src/uts/common/sys/ccompile.h
@@ -158,8 +158,19 @@ extern "C" {
#define __packed __attribute__((__packed__))
#define __section(x) __attribute__((__section__(x)))
#define __unused __sun_attr__((__unused__))
+#ifdef DEBUG
+/* We want to discover unused variables in DEBUG build. */
+#define __maybe_unused
+#else
+/*
+ * In release build, disable warnings about variables
+ * which are used only for debugging.
+ */
+#define __maybe_unused __sun_attr__((__unused__))
+#endif
#define __used __attribute__((__used__))
#define __weak_symbol __attribute__((__weak__))
+#define __HIDDEN __attribute__((visibility("hidden")))
#ifdef __cplusplus
}