C++ port

fix, as describes in https://volkszaehler.org/pipermail/volkszaehler-dev/2012-July/001930.html