digitalmars.D.learn - Problem interacting with the console
- Jacob Carlborg (12/12) Mar 29 2012 I'm trying to port a C application to D. The problem I have is
- Jacob Carlborg (8/18) Mar 31 2012 If anyone else is interested, I finally find the problem. Some types
I'm trying to port a C application to D. The problem I have is interacting with the console. I'm using the POSIX "read" function, the problem is that in the D version the "read" function seems to never return. The C version works fine and prints "**********" after I press a key. I've created a small test case for the problem below: D code: http://pastebin.com/SsYZcjMG C code: http://pastebin.com/QyprKD17 Is suspect that it's something in the "initterm" function that isn't working properly. Any ideas? I'm using DMD 2.058 on Mac OS X. -- /Jacob Carlborg
Mar 29 2012
On 2012-03-29 21:51, Jacob Carlborg wrote:I'm trying to port a C application to D. The problem I have is interacting with the console. I'm using the POSIX "read" function, the problem is that in the D version the "read" function seems to never return. The C version works fine and prints "**********" after I press a key. I've created a small test case for the problem below: D code: http://pastebin.com/SsYZcjMG C code: http://pastebin.com/QyprKD17 Is suspect that it's something in the "initterm" function that isn't working properly. Any ideas? I'm using DMD 2.058 on Mac OS X.If anyone else is interested, I finally find the problem. Some types used by the termios struct was incorrectly declared resulting in the wrong size on 64bit. I've created a pull request for this in druntime: https://github.com/D-Programming-Language/druntime/pull/189 -- /Jacob Carlborg
Mar 31 2012