added changes suggested by  Zjnue Brzavi on the haxe forums to correct compile issues for C++ target