diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index f788925e..97f66408 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -20,6 +20,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ +#define _USE_MATH_DEFINES #include @@ -47,7 +48,6 @@ typedef int bool; #ifdef _WIN32 #include -#define M_PI 3.14159265358979323846264338327950288 #ifdef _MSC_VER #ifdef _WIN64 @@ -334,7 +334,11 @@ void sigint_callback_handler(int signum) { int main(int argc, char** argv) { int opt, i, result = 0; +#ifdef _WIN32 + const char* path = "nul"; +#else const char* path = "/dev/null"; +#endif const char* serial_number = NULL; int exit_code = EXIT_SUCCESS; struct timeval t_end; @@ -517,9 +521,6 @@ int main(int argc, char** argv) { } fd = fopen(path, "wb"); - if (fd == NULL) { - fd = fopen("nul", "wb"); - } if( fd == NULL ) { fprintf(stderr, "Failed to open file: %s\n", path); return EXIT_FAILURE;