-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Correct the definition of pthread_t
on Darwin
#4336
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: main
Are you sure you want to change the base?
Changes from all commits
42c2630
270dacd
594ad79
e82ba24
bf4833b
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 |
---|---|---|
|
@@ -5,7 +5,34 @@ pub type useconds_t = u32; | |
pub type blkcnt_t = i64; | ||
pub type socklen_t = u32; | ||
pub type sa_family_t = u8; | ||
pub type pthread_t = crate::uintptr_t; | ||
|
||
cfg_if! { | ||
if #[cfg(any( | ||
target_os = "macos", | ||
target_os = "ios", | ||
target_os = "tvos", | ||
target_os = "watchos", | ||
target_os = "visionos", | ||
))] { | ||
pub type __darwin_pthread_t = *mut _opaque_pthread_t; | ||
pub type pthread_t = __darwin_pthread_t; | ||
s! { | ||
pub struct __darwin_pthread_handler_rec { | ||
__routine: Option<unsafe extern "C" fn(*mut c_void)>, | ||
__arg: *mut c_void, | ||
__next: *mut __darwin_pthread_handler_rec, | ||
} | ||
pub struct _opaque_pthread_t { | ||
__sig: c_long, | ||
__cleanup_stack: *mut __darwin_pthread_handler_rec, | ||
__opaque: [c_char; __PTHREAD_SIZE__], | ||
} | ||
Comment on lines
+20
to
+29
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. One other thing, could you mark these |
||
} | ||
} else { | ||
pub type pthread_t = crate::uintptr_t; | ||
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. Could you add a comment |
||
} | ||
} | ||
|
||
pub type nfds_t = c_uint; | ||
pub type regoff_t = off_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.
This can be simplified to
cfg(target_vendor = "apple")