Fix for GCC in C++03 mode: move the file_state helper into namespace detail.