test_rnd1 fully converted to c++

Fix c++ detection macro in pagebuf.h
Revamp generation of compiler flags