make compilable for Apple LLVM
add truncateTable