fixed errors when compiling with Linaro 4.5 (credit: XxXPachaXxX and Show-p1984)