kopia lustrzana https://github.com/Hamlib/Hamlib
gr_pwin32.m4: Replace inline sleep() function
Building libltdl recursively with MinGW failed with an error of "sleep" being redefined. Commenting out the sleep() definition in config.h.in resulted in libtdl compiling but a linker failure in libyaesu as "_sleep" was not defined. A bit of searching reveals that the MS Windows API does not include "sleep" and MinGW does not include it either, hence the definition in gr_pwin32.m4 from the GNU Radio project. Uopn finding a MinGW User thread from 2007 that discussed this very issue, the following message hinted that using a CPP #define to wrap Windows Sleep() may work: http://mingw.5.n7.nabble.com/Help-where-is-the-C-language-sleep-function-tp8921p8925.html And indeed it seems to. Compilation is now clean with recursive libltdl and the rest of Hamlib, but does it work?Hamlib-3.0
rodzic
74a6e7e6b9
commit
a16dd4797a
|
@ -1,19 +1,19 @@
|
||||||
# Check for (mingw)win32 POSIX replacements. -*- Autoconf -*-
|
# Check for (mingw)win32 POSIX replacements. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright 2003 Free Software Foundation, Inc.
|
# Copyright 2003 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of GNU Radio
|
# This file is part of GNU Radio
|
||||||
#
|
#
|
||||||
# GNU Radio is free software; you can redistribute it and/or modify
|
# GNU Radio is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
# any later version.
|
# any later version.
|
||||||
#
|
#
|
||||||
# GNU Radio is distributed in the hope that it will be useful,
|
# GNU Radio is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GNU Radio; see the file COPYING. If not, write to
|
# along with GNU Radio; see the file COPYING. If not, write to
|
||||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
@ -89,7 +89,8 @@ int usleep(unsigned long usec); /* SUSv2 */
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
#endif
|
#endif
|
||||||
/* TODO: what about SleepEx? */
|
/* TODO: what about SleepEx? */
|
||||||
static inline unsigned int sleep (unsigned int nb_sec) { Sleep(nb_sec*1000); return 0; }
|
/* static inline unsigned int sleep (unsigned int nb_sec) { Sleep(nb_sec*1000); return 0; } */
|
||||||
|
#define sleep(seconds) Sleep((seconds)*1000)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GETTIMEOFDAY
|
#ifndef HAVE_GETTIMEOFDAY
|
||||||
|
|
Ładowanie…
Reference in New Issue