fixed compile errors with g++ 4.3 and replaced some c headers by their