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

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
Copy link
Member

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

Copy link
Contributor Author

@euantorano euantorano Sep 6, 2019

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:

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)

Copy link
Contributor Author

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.

Copy link
Member

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?

@euantorano euantorano force-pushed the fix/12135-and-12109-openbsd-pthread_key_t-and-time_t branch from 87556da to a05cd02 Compare October 10, 2019 21:10
@Araq
Copy link
Member

Araq commented Nov 11, 2019

Sorry for the delay.

@Araq Araq merged commit 7e68987 into nim-lang:devel Nov 11, 2019
@euantorano euantorano deleted the fix/12135-and-12109-openbsd-pthread_key_t-and-time_t branch November 11, 2019 16:32
alehander92 pushed a commit to alehander92/Nim that referenced this pull request Dec 2, 2019
* Fix nim-lang#12135 and fix nim-lang#12109 - fix OpenBSD type defs

* Fix Mode definition as in nim-lang#12132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pthread_key_t errors on OpenBSD posix.Time is defined as clong on OpenBSD when it should be a long long
3 participants