mirror of
https://github.com/espressif/openthread.git
synced 2026-08-24 11:19:51 +00:00
[types] remove unused CONTAINING_RECORD macro (#2482)
This commit is contained in:
committed by
Jonathan Hui
parent
7256270af0
commit
1dc8938d67
@@ -54,18 +54,6 @@ extern "C" {
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#else
|
||||
#ifndef CONTAINING_RECORD
|
||||
/*#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
|
||||
#define CONTAINING_RECORD(address, type, field) \
|
||||
((type *)((uint8_t*)(address) - offsetof(type, field)))
|
||||
#pragma GCC diagnostic pop*/
|
||||
#define BASE 0x1
|
||||
#define myoffsetof(s,m) (((size_t)&(((s*)BASE)->m))-BASE)
|
||||
#define CONTAINING_RECORD(address, type, field) \
|
||||
((type *)((uint8_t*)(address) - myoffsetof(type, field)))
|
||||
#endif /* CONTAINING_RECORD */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user