Skip to content
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

Conversation

@euantorano
Copy link
Contributor

commented Sep 5, 2019

Fixes #12135 and fixes #12109

Note that the posix_other_consts file is used (the same goes for posix_macos_amd64) as I can't get detect.nim to run on OpenBSD.

@@ -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

This comment has been minimized.

Copy link
@Araq

Araq Sep 5, 2019

Member

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>.

This comment has been minimized.

Copy link
@euantorano

euantorano Sep 6, 2019

Author Contributor

@Araq Yes, that is true on most systems. However, OpenBSD is a little different. Please see the below links:

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)

This comment has been minimized.

Copy link
@euantorano

euantorano Sep 6, 2019

Author Contributor

Additionally, it seems FreeBSD used to be the same, circa 2005.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.