diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 6513a3a23..6a251e26e 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2439,6 +2439,7 @@ extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(()); HAMLIB_EXPORT(void) rig_no_restore_ai(); #include +#include // so configure can pick up nanosleep on Win32 extern HAMLIB_EXPORT(int) hl_usleep(useconds_t msec); __END_DECLS diff --git a/src/sleep.c b/src/sleep.c index 3d080c82a..ef86592f2 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -38,6 +38,12 @@ #include #include #include +#include + +#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