Add qom specific ifdefs and solve the compilation erro