Add getopt code so that compilation is ok on windows