Yes this will working but NOT if you compile the code on non QNX system which is why I added the && defined(QNX). I guess for the second one you don’t need it since if it’s QNXNTO it imply that QNX is defined.
If you know your code is never going to be compile on a non QNX os then you don’t need QNX