Fix compile for gcc and clang