Added support for different compiler (tested with clang and gcc).