From c39b51327ba655915170b77e9dfbdf394b6b46f1 Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Thu, 19 Sep 2013 21:59:42 -0500 Subject: [PATCH] Revise test for MinGW with sleep() Revise the preprocessor conditional test for MinGW variables. Tested on all of my MinGW installations. The prior test was broken by MinGW 3.0 on Debian Unstable. --- adat/adat.c | 6 ++++-- tentec/paragon.c | 6 ++++-- tentec/tt550.c | 5 ++++- tests/testrig.c | 6 ++++-- tests/testtrn.c | 7 ++++--- yaesu/ft757gx.c | 6 ++++-- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/adat/adat.c b/adat/adat.c index cab58b3b5..4fe036421 100644 --- a/adat/adat.c +++ b/adat/adat.c @@ -58,8 +58,11 @@ * MinGW. So substitute the sleep definition below in such a case and * when compiling on Windows using MinGW where HAVE_SLEEP will be * undefined. + * + * FIXME: Needs better handling for all versions of MinGW. + * */ -#if defined(HAVE_SSLEEP) && (!defined(HAVE_SLEEP) || defined(_WIN32)) +#if (defined(HAVE_SSLEEP) || defined(_WIN32)) && (!defined(HAVE_SLEEP)) #include "hl_sleep.h" #endif @@ -3823,4 +3826,3 @@ DECLARE_PROBERIG_BACKEND(adat) // --------------------------------------------------------------------------- // END OF FILE // --------------------------------------------------------------------------- - diff --git a/tentec/paragon.c b/tentec/paragon.c index cf351f129..d166615b2 100644 --- a/tentec/paragon.c +++ b/tentec/paragon.c @@ -45,8 +45,11 @@ * MinGW. So substitute the sleep definition below in such a case and * when compiling on Windows using MinGW where HAVE_SLEEP will be * undefined. + * + * FIXME: Needs better handling for all versions of MinGW. + * */ -#if defined(HAVE_SSLEEP) && (!defined(HAVE_SLEEP) || defined(_WIN32)) +#if (defined(HAVE_SSLEEP) || defined(_WIN32)) && (!defined(HAVE_SLEEP)) #include "hl_sleep.h" #endif @@ -591,4 +594,3 @@ int tt585_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) return write_block(&rig->state.rigport, cmd, strlen(cmd)); } - diff --git a/tentec/tt550.c b/tentec/tt550.c index 7140023ae..6c2a9beb7 100644 --- a/tentec/tt550.c +++ b/tentec/tt550.c @@ -48,8 +48,11 @@ * MinGW. So substitute the sleep definition below in such a case and * when compiling on Windows using MinGW where HAVE_SLEEP will be * undefined. + * + * FIXME: Needs better handling for all versions of MinGW. + * */ -#if defined(HAVE_SSLEEP) && (!defined(HAVE_SLEEP) || defined(_WIN32)) +#if (defined(HAVE_SSLEEP) || defined(_WIN32)) && (!defined(HAVE_SLEEP)) #include "hl_sleep.h" #endif diff --git a/tests/testrig.c b/tests/testrig.c index 0c266c7c9..903af6a21 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -17,8 +17,11 @@ * MinGW. So substitute the sleep definition below in such a case and * when compiling on Windows using MinGW where HAVE_SLEEP will be * undefined. + * + * FIXME: Needs better handling for all versions of MinGW. + * */ -#if defined(HAVE_SSLEEP) && (!defined(HAVE_SLEEP) || defined(_WIN32)) +#if (defined(HAVE_SSLEEP) || defined(_WIN32)) && (!defined(HAVE_SLEEP)) #include "hl_sleep.h" #endif @@ -372,4 +375,3 @@ int main (int argc, char *argv[]) return 0; } - diff --git a/tests/testtrn.c b/tests/testtrn.c index c056e6a53..2cb0abb12 100644 --- a/tests/testtrn.c +++ b/tests/testtrn.c @@ -17,8 +17,11 @@ * MinGW. So substitute the sleep definition below in such a case and * when compiling on Windows using MinGW where HAVE_SLEEP will be * undefined. + * + * FIXME: Needs better handling for all versions of MinGW. + * */ -#if defined(HAVE_SSLEEP) && (!defined(HAVE_SLEEP) || defined(_WIN32)) +#if (defined(HAVE_SSLEEP) || defined(_WIN32)) && (!defined(HAVE_SLEEP)) #include "hl_sleep.h" #endif @@ -104,5 +107,3 @@ int main (int argc, char *argv[]) return 0; } - - diff --git a/yaesu/ft757gx.c b/yaesu/ft757gx.c index fde380dab..e2c414f79 100644 --- a/yaesu/ft757gx.c +++ b/yaesu/ft757gx.c @@ -58,8 +58,11 @@ * MinGW. So substitute the sleep definition below in such a case and * when compiling on Windows using MinGW where HAVE_SLEEP will be * undefined. + * + * FIXME: Needs better handling for all versions of MinGW. + * */ -#if defined(HAVE_SSLEEP) && (!defined(HAVE_SLEEP) || defined(_WIN32)) +#if (defined(HAVE_SSLEEP) || defined(_WIN32)) && (!defined(HAVE_SLEEP)) #include "hl_sleep.h" #endif @@ -734,4 +737,3 @@ int rig2mode(RIG *rig, int md, rmode_t *mode, pbwidth_t *width) return RIG_OK; } -