diff options
| author | Jakob Kaivo <jkk@ung.org> | 2020-08-16 14:11:32 -0400 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2020-08-16 14:11:32 -0400 |
| commit | 77d0069e522400b63c2182fcc5f852718e4e6f2c (patch) | |
| tree | 6713710011e6e24ebc589d4fa32093e5af329afc /src/stddef/offsetof.h | |
| parent | 896e28812c51b9ffdf3efc00c7d7ef699e380a58 (diff) | |
rename files that should never be compiled on their own to .h
Diffstat (limited to 'src/stddef/offsetof.h')
| -rw-r--r-- | src/stddef/offsetof.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/stddef/offsetof.h b/src/stddef/offsetof.h new file mode 100644 index 00000000..2b0d158e --- /dev/null +++ b/src/stddef/offsetof.h @@ -0,0 +1,14 @@ +#define offsetof(__type, __member) ((size_t)((void*)&(((__type*)0)->__member))) + +/** get offset of a structure member **/ + +/*** +determines the offset, in bytes, of a specified field in a TYPE(struct). +***/ + +/* +PROTOTYPE(size_t offsetof(<var>type</var>, <var>member</var>);) +RETURN_SUCCESS(the offset of ARGUMENT(member) in ARGUMENT(type)) +UNDEFINED(ARGUMENT(member) is a bit-field) +STDC(1) +*/ |
