mirror of
https://github.com/Hamlib/Hamlib
synced 2026-08-13 17:32:05 -04:00
Possible fix for mingw Win32 dll linking of nanosleep
This commit is contained in:
parent
97ea79082a
commit
5ae03f0eed
2 changed files with 11 additions and 0 deletions
|
|
@ -2439,6 +2439,7 @@ extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(());
|
|||
HAMLIB_EXPORT(void) rig_no_restore_ai();
|
||||
|
||||
#include <unistd.h>
|
||||
#include <pthread.h> // so configure can pick up nanosleep on Win32
|
||||
extern HAMLIB_EXPORT(int) hl_usleep(useconds_t msec);
|
||||
|
||||
__END_DECLS
|
||||
|
|
|
|||
10
src/sleep.c
10
src/sleep.c
|
|
@ -38,6 +38,12 @@
|
|||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// In order to stop the usleep warnings in cppcheck we provide our own interface
|
||||
// So this will use system usleep or our usleep depending on availability of nanosleep
|
||||
|
|
@ -91,3 +97,7 @@ int usleep(useconds_t usec)
|
|||
return 0;
|
||||
}
|
||||
#endif // HAVE_NANOSLEEP
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue