Each enum will have its own #_get_string (), and each flags will have its own #_build_string_from_mask ().
Don't include anything in the templates specific to the file to be built, like #ifdef guards in headers or #include in sources.