Possible fix for mingw Win32 dll linking of nanosleep

This commit is contained in:
Michael Black 2020-01-08 22:50:37 -06:00
parent 97ea79082a
commit 5ae03f0eed
No known key found for this signature in database
GPG key ID: 6599353EC683404D
2 changed files with 11 additions and 0 deletions

View file

@ -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

View file

@ -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