From fb88fda5cbf797518cffd6c4741abcfb639dd2e7 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Thu, 2 Feb 2017 13:54:20 -0700 Subject: [PATCH] upm_utilities: Add a _POSIX_C_SOURCE define if needed In certain systems, where -std=c11 is used, certain posix extensions are disabled unless specifically enabled. On these systems, this could cause usleep() and/or nanosleep() to fail with an implicit declaration warning. This patch ensures that at least POSIX 200809 is used, if otherwise undefined. This should fix Issue #513. Signed-off-by: Jon Trulson --- src/utilities/upm_utilities.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utilities/upm_utilities.c b/src/utilities/upm_utilities.c index 578d24d6..2cce14e2 100644 --- a/src/utilities/upm_utilities.c +++ b/src/utilities/upm_utilities.c @@ -23,6 +23,10 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef _POSIX_C_SOURCE +// We need at least 199309L for nanosleep() +# define _POSIX_C_SOURCE 200809L +#endif #include #include #include