Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the macros O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK must be defined if no defined previously #179

Closed
gmuro opened this issue Dec 11, 2014 · 3 comments

Comments

@gmuro
Copy link
Contributor

gmuro commented Dec 11, 2014

the macros O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK must be defined if no defined previously. And include ciaaPOSIX_stdio.h after stdio.h (if necessary include stdio.h :)

@mcerdeiro
Copy link
Contributor

is possible to use the same values as linux?

@gmuro
Copy link
Contributor Author

gmuro commented Mar 18, 2015

yes, temporary solution...

@evolentini
Copy link
Contributor

We need to include stdio.h because emulated version of driver needs access to the host functions open, read, write and close. We can't change the macros to avoid a new definition if it is previously defined. It isn't a solution because the stdio.h is not included in all files of project and as result we'd have a macro with a value in ciaaDriversSerial.c and a different value in Blinking.c.
The solution currently implemented is using the same value of unix and include the host system includes before of ciaa includes. By this way if exist an redefinition of macro, the compiler'll generate a warning. The problem is that O_RDONLY is a macro and the warning is generated even if value is the same but it is written in different form, for example 1 and 0x0001
I believe that the only complete solution for this problem is change macro's name to CIAA_O_RDONLY, but I don't like it.

evolentini added a commit that referenced this issue Mar 21, 2015
evolentini added a commit that referenced this issue Mar 24, 2015
gmuro added a commit that referenced this issue Aug 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants