Begin conversion to C++ (first stage)

Include platform.h (which was missing)
Include missing typedefs