fixed to support clang and gcc