Hi,

I would like to understand how errno is handled with cegcc and more
precisely with mingw32ce.
I know that on ce platforms errno doesn't exist but if I need to build a
third party library using the native OS libc and using errno how can I do?
I always have the option to comment all the errno occurences in the code
but is there another option ?

Another thing I don't understand is that in
/opt/mingw32ce/arm-mingw32ce/include there is a errno.h so in which case
this define is used ?
For instance let's take this simple code : 

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine,
int nCmdShow)
{
    int i = 22;
}

when compiling it with mingw32ce  : ./arm-mingw32ce-gcc testerrno.c
I get an error from compiler testerrno.c:4: error: expected ')' before
'hInstance'

That's normal because windows stuff is unknow so when I add the good
defines it works fine:


// Adding missing include
#include <windows.h>

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine,
int nCmdShow)
{
    int i = 22;
}



So now if I add a test with errno like this :

// Adding missing include
#include <windows.h>
#include <errno.h>

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine,
int nCmdShow)
{
    int i = 22;

    errno = 0;
}


$ ./arm-mingw32ce-gcc testerrno.c
In file included from testerrno.c:2:
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.1.0/../../../../arm-mingw32ce/include/errno.h:12:25:
error: no include path in which to search for errno.h
testerrno.c: In function 'WinMain':
testerrno.c:8: error: 'errno' undeclared (first use in this function)
testerrno.c:8: error: (Each undeclared identifier is reported only once
testerrno.c:8: error: for each function it appears in.)


>From what I understand compiler cannot even find the include errno.h BUT
errno.h exists in the same folder as windows.h
(/opt/mingw32ce/arm-mingw32ce/include).
So why it can find windows.h and not errno.h ????








-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to