Have found for now a small problem in SDK, which easy to reproduce. The problem happens _ONLY_ when uses __USE_ONLINE__ . The code for reproduce:
Code: Select all
#include <proto/socket.h> // or for example <proto/bsdsocket.h> will give the same
#include <unistd.h>
test()
{
closesocket(NULL);
}
Code: Select all
ppc-amigaos-gcc -D__USE_INLINE -c test.c
Code: Select all
In file included from /usr/local/amiga/ppc-amigaos/SDK/newlib/include/unistd.h:4,
from closesocket.c:2:
/usr/local/amiga/ppc-amigaos/SDK/newlib/include/sys/unistd.h:96:33: error: macro "getdtablesize" passed 1 arguments, but takes just 0
In file included from /usr/local/amiga/ppc-amigaos/SDK/newlib/include/unistd.h:4,
from closesocket.c:2:
/usr/local/amiga/ppc-amigaos/SDK/newlib/include/sys/unistd.h:98: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
Code: Select all
#include <unistd.h>
#include <proto/socket.h> // or for example <proto/bsdsocket.h> will give the same
test()
{
closesocket(NULL);
}
Without __USE_INLINE__ no errors at all. They happens only with __USE_INLINE__ provided, and only when including of socket's protos are at top.
Of course, one can say something like "plz, unistd.h firstly all the time" , but, as i see in all the sources of many projects, and from all my past expirience, its all not so matter will i put it at top, or at bottom. Includes imho should worry about such kind of stuff, and parse it correctly (and as i say without __USE_INLINE__ test case works in any orders, be unistd.h at top, or at bottom, not so matter).
Can someone from core-devs check this out and fix ?
Thanks for