-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix #12135 and #12109 #12137
Fix #12135 and #12109 #12137
Conversation
@@ -132,6 +132,13 @@ else: | |||
abi: array[56 div sizeof(clong), clong] | |||
ThreadVarSlot {.importc: "pthread_key_t", | |||
header: "<sys/types.h>".} = distinct cuint | |||
elif defined(openbsd) and defined(amd64): | |||
type | |||
SysThread* {.importc: "pthread_t", header: "<pthread.h>".} = object |
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.
https://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread.h.html
The pthread_attr_t, pthread_cond_t, pthread_condattr_t, pthread_key_t, pthread_mutex_t, pthread_mutexattr_t, pthread_once_t, pthread_rwlock_t, pthread_rwlockattr_t and pthread_t types are defined as described in <sys/types.h>.
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.
@Araq Yes, that is true on most systems. However, OpenBSD is a little different. Please see the below links:
pthread.h
- see the type definitions from the linked line downwards- A search for
pthread_key_t
in the OpenBSD source - note the only definition is inpthread.h
sys/types.h
- note no references topthread
at all
I made this PR after actually trying the tests on OpenBSD and having them fail due to pthread_key_t
being undefined in sys/types.h
. This PR is the only way to make the tests pass on OpenBSD (see the error message in the linked issue for a stacktrace and compiler output - #12135)
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.
Additionally, it seems FreeBSD used to be the same, circa 2005.
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.
@Araq what is the status of this one?
87556da
to
a05cd02
Compare
Sorry for the delay. |
* Fix nim-lang#12135 and fix nim-lang#12109 - fix OpenBSD type defs * Fix Mode definition as in nim-lang#12132
Fixes #12135 and fixes #12109
Note that the
posix_other_consts
file is used (the same goes forposix_macos_amd64
) as I can't getdetect.nim
to run on OpenBSD.