Recover some missing includes and defines

While compiling (for openSUSE) from Sankore-3.1 master some errors came out, it appears due to some missing includes and defines. By comparing last commit (Jan 31, 2013 - fixed licence to gpl3) with the previous commit, some of them (hopefully all of them) got recovered (is it possible they got missing while updating license header during Jan 31, 2013 commit?).
Anyway, now sources appear to compile again (with openSUSE, at least)... in brief decided might be the case to issue a pull request: hope these infos are not (too) redundant for the devs and that might be of some usefulness, in some way.
Regards and of course infinite thanks for this wonderful tool.