From: robertlipe Date: Wed, 17 Jul 2013 01:30:52 +0000 (+0000) Subject: Modification of the round() workaround for MSVC, defining in defs.h instead of lowran... X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~517 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=45ff1ca013c03d10717d5bf3c5ccaa9520517ea4;p=gpsbabel.git Modification of the round() workaround for MSVC, defining in defs.h instead of lowrance*.cc --- diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index c426f5a3e..17361a9f8 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -1037,6 +1037,13 @@ char* rot13(const QString& str); signed int si_round(double d); +#if _MSC_VER +//These functions are not included in the MS pre C99 implementation, use internal implementation +//This asssumes that non-_MSC_VER includes math.h (all should include defs.h) +#define round si_round +#define lround si_round +#endif + /* * Data types for Palm/OS files. */ diff --git a/gpsbabel/lowranceusr.cc b/gpsbabel/lowranceusr.cc index 3171a255b..0c1685b5d 100644 --- a/gpsbabel/lowranceusr.cc +++ b/gpsbabel/lowranceusr.cc @@ -36,11 +36,6 @@ #include #include /* for lat/lon conversion */ -#if defined(_MSC_VER) -//Incomplete implementation, use existing GB function -#define lround si_round -#endif - typedef struct lowranceusr_icon_mapping { const int value; const char* icon; diff --git a/gpsbabel/lowranceusr4.cc b/gpsbabel/lowranceusr4.cc index 6f26cca10..db8ccfaa3 100644 --- a/gpsbabel/lowranceusr4.cc +++ b/gpsbabel/lowranceusr4.cc @@ -30,11 +30,6 @@ #include /* for lat/lon conversion */ #include /* for gmtime */ -#if defined(_MSC_VER) -//Incomplete implementation, use existing GB function -#define round si_round -#endif - /* from waypt.c, we need to iterate over waypoints when extracting routes */ extern queue waypt_head;