-
Notifications
You must be signed in to change notification settings - Fork 69
Declare ptraddr_t in (sys/)stddef.h and not in stdint.h #2495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
9900244
09e6fa6
9742115
1746147
dd648c8
66b8743
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,7 @@ | ||
| #include_next <sys/types.h> | ||
|
|
||
| #ifndef _PTRADDR_T_DECLARED | ||
| #ifdef __PTRADDR_TYPE__ | ||
| typedef __PTRADDR_TYPE__ __ptraddr_t; | ||
| #else | ||
| typedef size_t __ptraddr_t; | ||
| #endif | ||
| typedef __ptraddr_t ptraddr_t; | ||
| typedef size_t ptraddr_t; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If our sys/types.h doesn't define it then OpenZFS's shouldn't really either... |
||
| #define _PTRADDR_T_DECLARED | ||
| #endif | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| #error do not include this header, use machine/atomic.h | ||
| #endif | ||
|
|
||
| #include <sys/stddef.h> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's this one for? The header doesn't use ptraddr_t AFAICT.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. {arm64,riscv}/include/atomic.h use ptraddr_t and get sys/types.h from here. |
||
| #include <sys/types.h> | ||
|
|
||
| #define __atomic_load_bool_relaxed(p) (*(const volatile _Bool *)(p)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| #ifndef _SYS_MEMRANGE_H_ | ||
| #define _SYS_MEMRANGE_H_ | ||
|
|
||
| #include <sys/stddef.h> | ||
| #include <sys/ioccom.h> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alphabetise |
||
|
|
||
| /* Memory range attributes */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| #define _SYS_PMCLOG_H_ | ||
|
|
||
| #include <sys/pmc.h> | ||
| #include <sys/stddef.h> | ||
|
|
||
| enum pmclog_type { | ||
| /* V1 ABI */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't sys/types.h include this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, include or define ptraddr_t itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Which would remove the need for a large chunk of this diff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not strictly opposed (at least for internal source), but that's not the case for ptrdiff_t.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I was looking at (s)size_t, but indeed (u)intptr_t and ptrdiff_t are not. I guess the set of types in sys/types.h is the set that ye olde Unix systems defined, and then all these new-fangled types are only used by new code that knows about ISO C headers.