-
-
Notifications
You must be signed in to change notification settings - Fork 416
Fixes bug http://d.puremagic.com/issues/show_bug.cgi?id=5206 and introduces statvfs #257
Conversation
Thanks for contributing to druntime.
|
Hi! Tanks! Best regards, Robert |
@dawgfoto I'll assign this to you - please let @eskimor know how to proceed. Thanks! |
ping on this |
We try to keep this headers standard compliant. I think what we're currently porting is roughly SUSv3 (POSIX.1-2001 + XSI) which you'll get if @complexmath do you have any further information? http://pubs.opengroup.org/onlinepubs/009604499/nfindex.html This means __USE_XOPEN2K8, _BSD_SOURCE, _SVID_SOURCE, __USE_GNU, http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html If __WORDSIZE is widely used in linux headers then it makes sense to declare it here. We should probably comment that these are global glibc/linux defines. I intend to start a test suite for druntime and would like to see your unit test in there, but I'm not so positive about ad-hoc unittest additions to the makefile. Please watch out to avoid tabs and trailing whitespace and use K&R style braces if it's the predominant style. There is also a small D style guide. |
|
||
version(Alpha) { | ||
enum __WORDSIZE=64; | ||
} |
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.
Would it be possible to use D_LP64 instead?
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.
Well at least on x86 it seems to be the same. Thanks! I'll use it instead.
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.
__WORDSIZE
should be determinable from D_LP64
on all relevant platforms these days.
Thanks very lot for your comments, I will examine your comments and proposals thoroughly. I am sorry for the delay as I was on holiday the last two weeks, but I just came back and I am motivated :-) unittests: absolutely. It is also pretty redundant work to add struct unit tests for every struct, unfortunately C has no mixins. But a code generator would do. If desired, I could write a pair of D mixin and C code generator for this purpose. Maybe having a directory for auto generated C unit test helper functions, which are automatically included in the unittest build? Should I remove the unit tests for now from the pull request? Or leave them until we have a better solution? Thanks for the style guidelines, I will adhere to them in the next update. |
No need to hurry.
I'd opt for leaving them out for now. I want to start a test suite like dmd and there would be plenty of space for such tests, so it's probably even OK to write and extend them manually. |
enum __WORDSIZE=32; | ||
} | ||
|
||
version(MIPS6) { |
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.
MIPS64
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.
thanks!
Alrighty, waiting for one week on this. |
Avoided unrelated whitspace changes. Removed unit tests, as they are being replaced by a more general suite, according to Martin Nowak. Work in progress. Not yet tested.
Added version(posix) section in config, currently not used. Fixed whitespace in config.
As suggested by Martin Nowak.
Just updated request. It now only contains the needed changes to make struct stat work. Although the unit tests are now no longer included in the request, I tested the commit with them and they worked with both MODEL=32 and MODEL=64. In addition I tested my deimos-fuse wrapper with it and it seems to work too. |
I merged this with some smaller adjustments ccaa0ef, thanks. |
Hi!
This little patch fixes afore mentioned bug, that the stat struct is not correct on Linux systems.
It also introduces a unit test for testing the correctness. In addition I added the statvfs struct for Linux systems, also with unit test.