Writing in C is more or less portable as long as you make no suppositions about the sizes of your types and the pointers you use to access them. I personally prefer using the types defined in stdint.h
(http://pubs.opengroup.org/onlinepubs/7999959899/basedefs/stdint.h.html) - this defines like uint8_t
, uint16_t
... - but feel free to research more alternatives, such as types.h
(from POSIX Standard: 2.6 Primitive System Data Types) which defines them as u_int8_t
etc ...
Possibly, you will end up at the end defining your own types based on what you managed to mangle together from the various sources found on the net ... such as: game_int_16
,game_int_32
...