www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [help] getErrno

reply Ant <Ant_member pathlink.com> writes:
Is there any know issue with getErrno on windows XP and dmd 0.102?

I get a link error:

Error 42: Symbol Undefined _getErrno

thanks,

Ant
Oct 28 2004
parent reply Sean Kelly <sean f4.ca> writes:
In article <clrthe$qu5$1 digitaldaemon.com>, Ant says...
Is there any know issue with getErrno on windows XP and dmd 0.102?

I get a link error:

Error 42: Symbol Undefined _getErrno
I don't think so, unless getErrno was implemented after 0.102. I've actually just about finished a fairly complete implementation of the standard C headers (incorporating stuff from DMD and DMC when needed). If you're so inclined, they're available here: http://home.f4.ca/sean/d/stdc.zip I'm updating them quite frequently, so if you grab them be sure to check back often. That said, in testing I noticed that you don't need getErrno and setErrno to operate on this value. Simply defining: extern (C) int errno; is enough. And if that doesn't work, try this: extern (C) int* _errno(); Both are exposed in the DMC libraries. If you're on Linux, you may have to do some digging, but the first declaration should likely work there too. Sean
Oct 28 2004
next sibling parent Ant <Ant_member pathlink.com> writes:
In article <clruup$t03$1 digitaldaemon.com>, Sean Kelly says...
In article <clrthe$qu5$1 digitaldaemon.com>, Ant says...
Is there any know issue with getErrno on windows XP and dmd 0.102?

I get a link error:

Error 42: Symbol Undefined _getErrno
I don't think so, unless getErrno was implemented after 0.102. I've actually just about finished a fairly complete implementation of the standard C headers (incorporating stuff from DMD and DMC when needed). If you're so inclined, they're available here: http://home.f4.ca/sean/d/stdc.zip I'm updating them quite frequently, so if you grab them be sure to check back often. That said, in testing I noticed that you don't need getErrno and setErrno to operate on this value. Simply defining: extern (C) int errno; is enough. And if that doesn't work, try this: extern (C) int* _errno(); Both are exposed in the DMC libraries. If you're on Linux, you may have to do some digging, but the first declaration should likely work there too.
thanks. I'll try accessing errno directly. on phobos there is the errno.c with getErrno() and one of the std declares it as extern(C) getErrno() (something like that) but now I have to revert to 102 (see my post on the bugs group) (I just downloaded your stdc) Ant
Oct 28 2004
prev sibling parent reply Ant <Ant_member pathlink.com> writes:
In article <clruup$t03$1 digitaldaemon.com>, Sean Kelly says...
operate on this value.  Simply defining:

extern (C) int errno;
\DD\dm\lib\SNN.lib(cinit) Offset 0682CH Record Type 0090 Error 1: Previous Definition Different : _errno :(
is enough.  And if that doesn't work, try this:

extern (C) int* _errno();
OK :) thanks! Ant
Oct 28 2004
parent Sean Kelly <sean f4.ca> writes:
In article <cls1pa$101t$1 digitaldaemon.com>, Ant says...
In article <clruup$t03$1 digitaldaemon.com>, Sean Kelly says...
operate on this value.  Simply defining:

extern (C) int errno;
\DD\dm\lib\SNN.lib(cinit) Offset 0682CH Record Type 0090 Error 1: Previous Definition Different : _errno
Well that stinks. It works for me, but then I'm not running off a default install. BTW, as promised, I just uploaded a new version of the stdc stuff. I had to change all the wchar stuff back to wchar_t because the sizes are different on Windows vs. Unix :p Sean
Oct 28 2004