Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7ASAP

Reply
Thread Tools

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7ASAP

 
 
Martin v. Loewis
Guest
Posts: n/a
 
      07-07-2010
Am 07.07.2010 22:35, schrieb sturlamolden:
> On 7 Jul, 22:26, Christian Heimes <li...@cheimes.de> wrote:
>
>> Don't forget errno! Every CRT might have its own errno thread local. I
>> don't know how its handled on Windows but I suspect it suffers from the
>> same problem.

>
> The Windows API "errno" is GetLastError. But a delinquent CRT might
> map GetLastError() to other integers.


Please check the source before posting. msvcrt defines errno as

_CRTIMP extern int * __cdecl _errno(void);
#define errno (*_errno())

where _errno is (see dosmap.c)

int * __cdecl _errno(void)
{
_ptiddata ptd = _getptd_noexit();
if (!ptd) {
return &ErrnoNoMem;
} else {
return ( &ptd->_terrno );
}

}

where _getptd_noexit returns the CRT's per-thread data (see tidtable.c).

So it *is* a mapping to other integers, and, even though it's called
dosmap.c, it is maintained because of the (limited) POSIX support in the
CRT. In particular, there is a mapping between GetLastError values and
errno values that can't be implemented through simple defines
(e.g. both ERROR_FILE_NOT_FOUND and ERROR_PATH_NOT_FOUND map to ENOENT).
In addition, a standard C implementation can rely on only certain APIs
changing errno, which MS perhaps might not be able to guarantee for
GetLastError values in exactly the same manner.

So with the way the Windows API is defined, a C implementation has no
alternative but to be delinquent.

Regards,
Martin
 
Reply With Quote
 
 
 
 
sturlamolden
Guest
Posts: n/a
 
      07-07-2010
On 7 Jul, 23:33, "Martin v. Loewis" <mar...@v.loewis.de> wrote:

> > The Windows API "errno" is GetLastError. But a delinquent CRT might
> > map GetLastError() to other integers.

>
> Please check the source before posting. msvcrt defines errno as


I don't have the source to msvcrt, at least not to my knowledge.




 
Reply With Quote
 
 
 
 
Martin v. Loewis
Guest
Posts: n/a
 
      07-07-2010
Am 07.07.2010 23:49, schrieb sturlamolden:
> On 7 Jul, 23:33, "Martin v. Loewis" <mar...@v.loewis.de> wrote:
>
>>> The Windows API "errno" is GetLastError. But a delinquent CRT might
>>> map GetLastError() to other integers.

>>
>> Please check the source before posting. msvcrt defines errno as

>
> I don't have the source to msvcrt, at least not to my knowledge.


If you have Visual Studio, and opted to install the CRT sources,
you'll find them in VC/crt/src (or VC7/crt/src, depending on VS
version). I'm not 100% sure whether they are included in VS Express as well.

Regards,
Martin
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSE 4 11-15-2006 02:40 AM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola Microsoft Certification 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSD 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd realexxams@yahoo.com Microsoft Certification 0 05-10-2006 02:35 PM
microsoft.public.dotnet.faqs,microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.dotnet.general,microsoft.public.dotnet.languages.vb Charles A. Lackman ASP .Net 1 12-08-2004 07:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57