kubilus1 / gendev

Genesis development environment for Linux.
BSD 3-Clause "New" or "Revised" License
208 stars 23 forks source link

<stdint.h> must be included before <genesis.h> #33

Closed minerscale closed 7 years ago

minerscale commented 7 years ago

Hello. While I was trying to get the Echo sound engine working with my game, I realised that it won't let me include . So I created a new project with the absoloute bare minimum and the (bug?) is repeatable.

Here's my test rig:

test.zip

And here's the error(s):

`In file included from /opt/gendev/sgdk/inc/genesis.h:7:0, from main.c:1: /opt/gendev/sgdk/inc/types.h:142:21: error: conflicting types for 's8'

define int8_t s8

                 ^

/opt/gendev/sgdk/inc/types.h:79:14: note: previous declaration of 's8' was here typedef char s8; ^~ `

Any help getting this up and running would be greatly appreciated, and if it's an SGDK bug lemme know so I can put this bug report into SGDK. Meanwhile I'll try to find a solution

minerscale commented 7 years ago

Ok, I found a workaround? I just changed the order I included the files. If I include before it compiles. But if I do it the other way around, it doesn't.

Does this still pass as a bug? Are there other examples of this happening?

andwn commented 7 years ago

SGDK defines the types (like uint16_t etc) if it detects that stdint.h is not included. Of course, if stdint.h is included after, it won't detect it, so there you get the "conflicting types" due to SGDK defining it first. I'm not sure what the logic behind the decision to do that was. I'd ask Stef about it.

minerscale commented 7 years ago

Oooh, ok. Well, that seems a bit strange. It doesn't matter anyway. Do I close it now?

kubilus1 commented 7 years ago

Yeah, I think we will close it since it is an SGDK, not exactly issue, but behavior.