platform-specific handling of option parsing and directory iteration. gen.c: use gen-unix.h/gen-win32.h