Closed ComputerNerd closed 9 years ago
SMSlib.c does in fact include stdbool.h and you should also include it in your sources, before including SMSlib.h
Do you mean in main.c I should add #include "SMSlib.c"?
What I have right now works without that include and in fact including SMSlib.c as if it were a header will cause multiple definition problems if you have multiple source code files.
Here is how I currently compile devkitSMS along with my project https://github.com/ComputerNerd/Retro-Graphics-Toolkit/blob/master/examples/masterSystem/C/Makefile All the makefile does is just compile all sources listed in the SOURCE variable and then link together all the generated object files.
I meant you should also include stdbool.h in your C source, before including SMSlib.h
Sorry for the confusion that does make much more sense. I thought the intention was that SMSlib.h should be able to function without any prerequisites. Also I should have been more clear that I meant using SMSlib.h in my code. I used bad wording initially.
I followed your suggestion and switched from 'bool' to '_Bool'. Also, the library now resets the sprites on initialization. Thanks for your comments!
I am wondering how you were able to compile devkitSMS without the extra include. What stdbool.h does according to http://pubs.opengroup.org/onlinepubs/9699919799//basedefs/stdbool.h.html is expand bool to _Bool which allows me to compile it. Doing a search and replace for bool changing it to _Bool also allows me to compile it.
In C there is no keyword that I am aware of called bool; only _Bool please see http://en.cppreference.com/w/c/keyword.
I am using the latest snapshot of SDCC as of the time of writing the issue which is: 3.5.2 #9277