summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2017-04-26 16:20:06 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2017-04-26 16:20:06 +0000
commit52d3b737c7b197c40565555b424a1dc1ed3ddbc6 (patch)
tree1803e8afb38e5bec39a2eb3afdbb0f7b270851ed /usr/src
parenta44dcbbe65f326617f147978ef5cee916f4b252e (diff)
downloadillumos-joyent-52d3b737c7b197c40565555b424a1dc1ed3ddbc6.tar.gz
Revert "Revert "8007 want sys/stddef.h for offsetof and container_of macros""
This reverts commit 73aad7bcbbe52de3391e9d36717401faa3fbed13. Conflicts: usr/src/uts/common/sys/stddef.h
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/head/iso/stddef_iso.h10
-rw-r--r--usr/src/head/stddef.h3
-rw-r--r--usr/src/pkg/manifests/system-header.mf1
-rw-r--r--usr/src/uts/common/sys/Makefile1
-rw-r--r--usr/src/uts/common/sys/sysmacros.h13
-rw-r--r--usr/src/uts/i86pc/dboot/dboot_multiboot2.c11
6 files changed, 5 insertions, 34 deletions
diff --git a/usr/src/head/iso/stddef_iso.h b/usr/src/head/iso/stddef_iso.h
index b94960793c..37e10aec4b 100644
--- a/usr/src/head/iso/stddef_iso.h
+++ b/usr/src/head/iso/stddef_iso.h
@@ -82,16 +82,6 @@ typedef unsigned int size_t; /* (historical version) */
}
#endif /* end of namespace std */
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define offsetof(s, m) __builtin_offsetof(s, m)
-#else
-#if __cplusplus >= 199711L
-#define offsetof(s, m) (std::size_t)(&(((s *)0)->m))
-#else
-#define offsetof(s, m) (size_t)(&(((s *)0)->m))
-#endif
-#endif /* GNUC, etc. */
-
#if !defined(_MAX_ALIGN_T)
#if !defined(_STRICT_SYMBOLS) || defined(_STDC_C11)
#define _MAX_ALIGN_T
diff --git a/usr/src/head/stddef.h b/usr/src/head/stddef.h
index 1e3d016048..6f04b7f7c9 100644
--- a/usr/src/head/stddef.h
+++ b/usr/src/head/stddef.h
@@ -31,10 +31,9 @@
#ifndef _STDDEF_H
#define _STDDEF_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/isa_defs.h>
#include <iso/stddef_iso.h>
+#include <sys/stddef.h>
/*
* Allow global visibility for symbols defined in
diff --git a/usr/src/pkg/manifests/system-header.mf b/usr/src/pkg/manifests/system-header.mf
index 7fec376963..4e135e7751 100644
--- a/usr/src/pkg/manifests/system-header.mf
+++ b/usr/src/pkg/manifests/system-header.mf
@@ -1433,6 +1433,7 @@ file path=usr/include/sys/stat_impl.h
file path=usr/include/sys/statfs.h
file path=usr/include/sys/statvfs.h
file path=usr/include/sys/stdbool.h
+file path=usr/include/sys/stddef.h
file path=usr/include/sys/stdint.h
file path=usr/include/sys/stermio.h
file path=usr/include/sys/stream.h
diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile
index 80d344523e..c44301765b 100644
--- a/usr/src/uts/common/sys/Makefile
+++ b/usr/src/uts/common/sys/Makefile
@@ -545,6 +545,7 @@ CHKHDRS= \
statfs.h \
statvfs.h \
stdbool.h \
+ stddef.h \
stdint.h \
stermio.h \
stmf.h \
diff --git a/usr/src/uts/common/sys/sysmacros.h b/usr/src/uts/common/sys/sysmacros.h
index 2e895a8daf..03be89f461 100644
--- a/usr/src/uts/common/sys/sysmacros.h
+++ b/usr/src/uts/common/sys/sysmacros.h
@@ -33,6 +33,7 @@
#define _SYS_SYSMACROS_H
#include <sys/param.h>
+#include <sys/stddef.h>
#ifdef __cplusplus
extern "C" {
@@ -369,18 +370,8 @@ extern unsigned char bcd_to_byte[256];
/* avoid any possibility of clashing with <stddef.h> version */
#if (defined(_KERNEL) || defined(_FAKE_KERNEL)) && !defined(_KMEMUSER)
-#if !defined(offsetof)
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define offsetof(s, m) __builtin_offsetof(s, m)
-#else
-#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
-#endif
-#endif /* !offsetof */
-
-#define container_of(m, s, name) \
- (void *)((uintptr_t)(m) - (uintptr_t)offsetof(s, name))
-
#define ARRAY_SIZE(x) (sizeof (x) / sizeof (x[0]))
+
#endif /* _KERNEL, !_KMEMUSER */
#ifdef __cplusplus
diff --git a/usr/src/uts/i86pc/dboot/dboot_multiboot2.c b/usr/src/uts/i86pc/dboot/dboot_multiboot2.c
index 4e01b0a222..ccf81cf773 100644
--- a/usr/src/uts/i86pc/dboot/dboot_multiboot2.c
+++ b/usr/src/uts/i86pc/dboot/dboot_multiboot2.c
@@ -24,17 +24,6 @@
#include <sys/multiboot2.h>
#include <sys/multiboot2_impl.h>
-/*
- * Remove offsetof definition when we have usable sys/stddef.h
- */
-#if !defined(offsetof)
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define offsetof(s, m) __builtin_offsetof(s, m)
-#else
-#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
-#endif
-#endif /* !offsetof */
-
struct dboot_multiboot2_iterate_ctx;
typedef boolean_t (*dboot_multiboot2_iterate_cb_t)