diff options
Diffstat (limited to 'gnulib-m4/nanosleep.m4')
| -rw-r--r-- | gnulib-m4/nanosleep.m4 | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gnulib-m4/nanosleep.m4 b/gnulib-m4/nanosleep.m4 index 81c45d8a..3a9967c8 100644 --- a/gnulib-m4/nanosleep.m4 +++ b/gnulib-m4/nanosleep.m4 @@ -1,6 +1,6 @@ # nanosleep.m4 -# serial 47 -dnl Copyright (C) 1999-2001, 2003-2025 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. @@ -144,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 |
