Page 1 of 1

[Answered] Being bitten by #defines for write, read and close (etc)

Posted: Sun May 21, 2017 10:39 pm
by kolban
When I write an application that uses both sockets and file I/O I am getting bitten over and over again by our apparent #define of the common POSIX APIs called write(), read(), close() etc. When I attempt to use POSIX I/O to read and write files, these appear to be macro re-defined to "lwip_<function>" which is obviously wrong. In addition, I am finding that if I create a C++ class such as:

class MyClass {
void write(char *data);
}

attempting to call the write() method of my class also appears to be affected by the sockets redefines. I haven't considered why macro re-defines were chosen or what we might do to alleviate the situation ... but I am of an opinion we need to try and do "something" to find this issue.

Re: Being bitten by #defines for write, read and close (etc)

Posted: Sun May 21, 2017 11:03 pm
by WiFive