fix posix.mq_receive compilation with cpp backend (#20710)

* fix posix.mq_receive compilation with cpp backend

* only enable runnableExample on posix

* linux, not posix

* simplify example

* add test

* mqueue.h does not exist on MacOS

* place test case in own block

* drop runnableExamples
This commit is contained in:
n5m 2022-11-05 05:31:19 +00:00 • committed by GitHub
commit 51bef9b4a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 88 additions and 28 deletions

View file

@ -108,15 +108,6 @@ type
p_sign_posn*: char
thousands_sep*: cstring
Mqd* {.importc: "mqd_t", header: "<mqueue.h>", final, pure.} = object
MqAttr* {.importc: "struct mq_attr",
header: "<mqueue.h>",
final, pure.} = object ## message queue attribute
mq_flags*: int ## Message queue flags.
mq_maxmsg*: int ## Maximum number of messages.
mq_msgsize*: int ## Maximum message size.
mq_curmsgs*: int ## Number of messages currently queued.
Passwd* {.importc: "struct passwd", header: "<pwd.h>",
final, pure.} = object ## struct passwd
pw_name*: cstring ## User's login name.