diff options
Diffstat (limited to 'gnulib-m4/nanosleep.m4')
| -rw-r--r-- | gnulib-m4/nanosleep.m4 | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/gnulib-m4/nanosleep.m4 b/gnulib-m4/nanosleep.m4 index a7281b8a..3a9967c8 100644 --- a/gnulib-m4/nanosleep.m4 +++ b/gnulib-m4/nanosleep.m4 @@ -1,9 +1,10 @@ # nanosleep.m4 -# serial 47 -dnl Copyright (C) 1999-2001, 2003-2024 Free Software Foundation, Inc. +# serial 48 +dnl Copyright (C) 1999-2001, 2003-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. dnl From Jim Meyering. dnl Check for the nanosleep function. @@ -143,6 +144,25 @@ AC_DEFUN([gl_FUNC_NANOSLEEP], ;; esac else + # Replace the static inline function on mingw which requires linking to + # libwinpthreads. + AC_CACHE_CHECK([for static inline nanosleep], + [gl_cv_static_inline_nanosleep], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <time.h>]], + [[ + static struct timespec ts1; + static struct timespec ts2; + return nanosleep (&ts1, &ts2); + ]]) + ], + [gl_cv_static_inline_nanosleep=yes], + [gl_cv_static_inline_nanosleep=no]) + ]) + if test $gl_cv_static_inline_nanosleep = yes; then + REPLACE_NANOSLEEP=1 + fi HAVE_NANOSLEEP=0 fi LIBS=$gl_saved_LIBS |
