summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_clang.h
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2017-07-18 17:13:40 +0300
committerValentin Bartenev <vbart@nginx.com>2017-07-18 17:13:40 +0300
commit9d707800b0c7090424ae6426423041e8755623ce (patch)
treee5f74ba80479ecd97d937eade77f13026022fd00 /src/nxt_clang.h
parentbeb4de21bb0709154b227821dd090e797d256ce5 (diff)
downloadunit-9d707800b0c7090424ae6426423041e8755623ce.tar.gz
unit-9d707800b0c7090424ae6426423041e8755623ce.tar.bz2
More accurate "packed" attribute declaration.
Diffstat (limited to 'src/nxt_clang.h')
-rw-r--r--src/nxt_clang.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nxt_clang.h b/src/nxt_clang.h
index 65bd7940..4b02b468 100644
--- a/src/nxt_clang.h
+++ b/src/nxt_clang.h
@@ -121,6 +121,17 @@ nxt_prefetch(a)
#endif
+#if (NXT_HAVE_GCC_ATTRIBUTE_PACKED)
+
+#define nxt_packed __attribute__((__packed__))
+
+#else
+
+#define nxt_packed
+
+#endif
+
+
#ifndef NXT_ALIGNMENT
#if (NXT_SOLARIS)
@@ -230,6 +241,4 @@ nxt_trunc_ptr(p, a) \
(u_char *) ((uintptr_t) (p) & ~((uintptr_t) (a) - 1))
-#define NXT_PACKED __attribute__((packed))
-
#endif /* _NXT_CLANG_H_INCLUDED_ */