Hi all,
I wanted to create a hacked-up version of Hacktarux' input plugin that supports joysticks/pads. My main problem strangely isn't the joypad stuff, but the C code in the plugin header file :sly:
I first started by compiling Hacktarux' input plugin from source. My gcc didn't like it I have gcc version 2.95.4 20011002 (Debian prerelease).
The union BUTTONS contains an unnamed struct to directly set the buttons and a placeholder called Value. This doesn't work with my gcc - it issues a nice warning
they even call it an evil MS-VC practice
So, what shall we do? Isn't it better to stick with conformance and change this into a double word which is manipulated bitwise through logical AND and OR? This would ensure binary compability with the VC approach.
I didn't post this into the plugins forum because I'm not sure if I'm right or wrong.
Cheers,
Obsidian
PS: Hacktarux, keep it up! 0.04 works great.
I wanted to create a hacked-up version of Hacktarux' input plugin that supports joysticks/pads. My main problem strangely isn't the joypad stuff, but the C code in the plugin header file :sly:
I first started by compiling Hacktarux' input plugin from source. My gcc didn't like it I have gcc version 2.95.4 20011002 (Debian prerelease).
The union BUTTONS contains an unnamed struct to directly set the buttons and a placeholder called Value. This doesn't work with my gcc - it issues a nice warning
(which is of course correct) and then won't allow the variables inside the struct to be accessed. So I had a look around the net and saw that this violates the ANSI/ISO C standard anyway. Under http://www.gdconf.com/archives/proceedings/2001/kreimeier/Controller_#1.1.h:77: warning: unnamed struct/union that defines no instances
they even call it an evil MS-VC practice
So, what shall we do? Isn't it better to stick with conformance and change this into a double word which is manipulated bitwise through logical AND and OR? This would ensure binary compability with the VC approach.
I didn't post this into the plugins forum because I'm not sure if I'm right or wrong.
Cheers,
Obsidian
PS: Hacktarux, keep it up! 0.04 works great.
Last edited: