fix stdc defs, include missing headers