kopia lustrzana https://github.com/Hamlib/Hamlib
Possible fix for mingw Win32 dll linking of nanosleep
rodzic
97ea79082a
commit
5ae03f0eed
|
@ -2439,6 +2439,7 @@ extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(());
|
||||||
HAMLIB_EXPORT(void) rig_no_restore_ai();
|
HAMLIB_EXPORT(void) rig_no_restore_ai();
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <pthread.h> // so configure can pick up nanosleep on Win32
|
||||||
extern HAMLIB_EXPORT(int) hl_usleep(useconds_t msec);
|
extern HAMLIB_EXPORT(int) hl_usleep(useconds_t msec);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
10
src/sleep.c
10
src/sleep.c
|
@ -38,6 +38,12 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <time.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
|
// 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
|
// 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;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif // HAVE_NANOSLEEP
|
#endif // HAVE_NANOSLEEP
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
Ładowanie…
Reference in New Issue