Fix compile with MSVC

This commit is contained in:
Jonas Kvinge
2021-08-24 17:52:08 +02:00
parent 55e038d345
commit d02241d32c
14 changed files with 114 additions and 59 deletions

View File

@@ -22,7 +22,9 @@
#include "version.h"
#include <cstdlib>
#include <getopt.h>
#ifndef _MSC_VER
# include <getopt.h>
#endif
#include <iostream>
#include <type_traits>
@@ -119,6 +121,7 @@ void CommandlineOptions::RemoveArg(const QString &starts_with, int count) {
bool CommandlineOptions::Parse() {
#ifndef _MSC_VER // TODO: Consider QCommandLineOption.
static const struct option kOptions[] = {
{"help", no_argument, nullptr, 'h'},
{"play", no_argument, nullptr, 'p'},
@@ -319,6 +322,8 @@ bool CommandlineOptions::Parse() {
}
}
#endif // _MSC_VER
return true;
}