diff options
author | Michael Brown <mcb30@ipxe.org> | 2016-03-18 08:18:31 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2016-03-18 08:18:31 +0000 |
commit | ef0297b527130ce851c3cb2276fb2729a28b254c (patch) | |
tree | 630700a2e1b0156a162c5033876f7fa4f6a4b3c1 /src/include/stddef.h | |
parent | 04ef198d2fcf864b82a722ee737eac88fc48b1a4 (diff) | |
download | ipxe-ef0297b527130ce851c3cb2276fb2729a28b254c.tar.gz |
[libc] Allow container_of() to be used on volatile pointers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/stddef.h')
-rw-r--r-- | src/include/stddef.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/stddef.h b/src/include/stddef.h index 3c056294f..fb01c489d 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -34,7 +34,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); */ #define container_of( ptr, type, field ) ( { \ type *__container; \ - const typeof ( __container->field ) *__field = (ptr); \ + const volatile typeof ( __container->field ) *__field = (ptr); \ __container = ( ( ( void * ) __field ) - \ offsetof ( type, field ) ); \ __container; } ) |