-
-
Notifications
You must be signed in to change notification settings - Fork 747
Add DragonFlyBSD support for phobos #5941
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
Changes from all commits
6c7031d
26cf405
5157abc
143b511
33034d2
58b5569
bf06f45
ca27cdf
a11f63f
4a1065e
1ad40c6
cae4a30
931854f
31ca73d
c5b7317
106954f
b712abc
24f0c95
7245be5
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 |
|---|---|---|
|
|
@@ -94,6 +94,10 @@ else version(FreeBSD) | |
| { | ||
| version = useSysctlbyname; | ||
| } | ||
| else version(DragonFlyBSD) | ||
| { | ||
| version = useSysctlbyname; | ||
| } | ||
| else version(NetBSD) | ||
| { | ||
| version = useSysctlbyname; | ||
|
|
@@ -984,6 +988,10 @@ uint totalCPUsImpl() @nogc nothrow @trusted | |
| { | ||
| auto nameStr = "hw.ncpu\0".ptr; | ||
| } | ||
| else version(DragonFlyBSD) | ||
| { | ||
| auto nameStr = "hw.ncpu\0".ptr; | ||
|
Contributor
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. Off topic: this looks like a very old style. IIRC are strings literals always zero-terminated?
Contributor
Author
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. Don't know, maybe someone else can answer this one.
Contributor
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. Yes, that's true, the string literals are always zero-terminated. I was wondering if something is also doing
Contributor
Author
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. @nemanja-boric-sociomantic The surrounding lines are doing the same, though. and i do not want to correct them (Only DragonFlyBSD related lines should be touched in this PR).
Contributor
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. I would leave them as is IMHO and do this separately (meaning just leave the |
||
| } | ||
| else version(NetBSD) | ||
| { | ||
| auto nameStr = "hw.ncpu\0".ptr; | ||
|
|
||
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.
For the record: I'm not a huge fan of copying blocks as this means a bug fix will very likely miss one of these bits.
Anyhow as far as I know is Walter a huge proponent of using
version(A)and not ofstatic if( A || B)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.
I completely agree. I did see this 'argument' pop up several time in different PR's and Forum discussions. I even wanted to suggest a generic 'BSD' version flag, as they all have common origins, similar to the 'Posix' version. But i did not want to reopen this discussion.
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.
Or maybe we do away with the asm implementation and implement a better poly algorithm.
https://issues.dlang.org/show_bug.cgi?id=12084
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.
It's possible too to put the implementation in a token string
enum polyAsm = q{ asm pure nothrow @nogc { ... } };and to mix itUh oh!
There was an error while loading. Please reload this page.
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.
I think this discussion should be had outside this PR. Sounds more like a structural (ie ASM) discussion, than pertaining to this particular PR (correct ?).