Skip to content

Commit

Permalink
tools: allow built-in functions for newer versions of MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoernchen committed Jun 8, 2015
1 parent 8b4d755 commit 5c376fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/rtl_adsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@

#ifdef _WIN32
#define sleep Sleep
#if defined(_MSC_VER) && (_MSC_VER < 1800)
#define round(x) (x > 0.0 ? floor(x + 0.5): ceil(x - 0.5))
#endif
#endif

#define ADSB_RATE 2000000
#define ADSB_FREQ 1090000000
Expand Down
4 changes: 2 additions & 2 deletions src/rtl_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#include <io.h>
#include "getopt/getopt.h"
#define usleep(x) Sleep(x/1000)
#ifdef _MSC_VER
#if defined(_MSC_VER) && (_MSC_VER < 1800)
#define round(x) (x > 0.0 ? floor(x + 0.5): ceil(x - 0.5))
#endif
#define _USE_MATH_DEFINES
Expand Down Expand Up @@ -271,7 +271,7 @@ int cic_9_tables[][10] = {
{9, -199, -362, 5303, -25505, 77489, -25505, 5303, -362, -199},
};

#ifdef _MSC_VER
#if defined(_MSC_VER) && (_MSC_VER < 1800)
double log2(double n)
{
return log(n) / log(2.0);
Expand Down
4 changes: 2 additions & 2 deletions src/rtl_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <io.h>
#include "getopt/getopt.h"
#define usleep(x) Sleep(x/1000)
#ifdef _MSC_VER
#if defined(_MSC_VER) && (_MSC_VER < 1800)
#define round(x) (x > 0.0 ? floor(x + 0.5): ceil(x - 0.5))
#endif
#define _USE_MATH_DEFINES
Expand Down Expand Up @@ -220,7 +220,7 @@ int cic_9_tables[][10] = {
{9, -199, -362, 5303, -25505, 77489, -25505, 5303, -362, -199},
};

#ifdef _MSC_VER
#if defined(_MSC_VER) && (_MSC_VER < 1800)
double log2(double n)
{
return log(n) / log(2.0);
Expand Down

0 comments on commit 5c376fc

Please sign in to comment.