Event trapping on Mac/Darwin. Changing a bit event trapping implementation due to compilers differences (mingw vs clang)