From: Bruno Haible Date: Tue, 3 Jun 2025 21:28:11 +0000 (+0200) Subject: fcntl-h: Fix configure test on MSVC. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48b315f19586218ea34a5161d71593bcb486efcf;p=thirdparty%2Fgnulib.git fcntl-h: Fix configure test on MSVC. * m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Reshuffle the exit code assignments again, so that a compilation failure produces the "no" result both on mingw and on MSVC. Fix typo in the test program. --- diff --git a/ChangeLog b/ChangeLog index abd0ee05b0..1aac32291c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-06-03 Bruno Haible + + fcntl-h: Fix configure test on MSVC. + * m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Reshuffle the exit code assignments + again, so that a compilation failure produces the "no" result both on + mingw and on MSVC. Fix typo in the test program. + 2025-06-03 Collin Funk setlocale: Update a comment. diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4 index 38321e5964..8020c481f7 100644 --- a/m4/fcntl-o.m4 +++ b/m4/fcntl-o.m4 @@ -1,5 +1,5 @@ # fcntl-o.m4 -# serial 11 +# serial 12 dnl Copyright (C) 2006, 2009-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -32,7 +32,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], #else /* on Windows with MSVC */ # include # include - # defined sleep(n) _sleep ((n) * 1000) + # define sleep(n) _sleep ((n) * 1000) #endif #include #include @@ -68,7 +68,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], if (fd >= 0) { close (fd); - result |= 2; + result |= 3; } } if (unlink (sym) != 0 || symlink (".", sym) != 0) @@ -79,7 +79,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], if (fd >= 0) { close (fd); - result |= 2; + result |= 3; } } unlink (sym); @@ -128,16 +128,20 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], return result;]])], [gl_cv_header_working_fcntl_h=yes], [AS_CASE([$?], - dnl We cannot catch exit code 1 here, because exit code 1 can occur - dnl through a compilation error (e.g. when O_NOCTTY, O_NONBLOCK, O_SYNC - dnl are not defined) or when result = 1. - [ 2], [gl_cv_header_working_fcntl_h="no (bad O_NOFOLLOW)"], + dnl We cannot catch exit code 1 or 2 here, because + dnl - exit code 1 can occur through a compilation error on mingw (e.g. + dnl when O_NOCTTY, O_NONBLOCK, O_SYNC are not defined) or when + dnl result = 1, whereas + dnl - exit code 2 can occur through a compilation error on MSVC (e.g. + dnl again when O_NOCTTY, O_NONBLOCK, O_SYNC are not defined) or when + dnl result = 2. + [ 3], [gl_cv_header_working_fcntl_h="no (bad O_NOFOLLOW)"], [ 4], [gl_cv_header_working_fcntl_h="no (bad O_DIRECTORY)"], - [ 6], [gl_cv_header_working_fcntl_h="no (bad O_NOFOLLOW, O_DIRECTORY)"], + [ 7], [gl_cv_header_working_fcntl_h="no (bad O_NOFOLLOW, O_DIRECTORY)"], [64], [gl_cv_header_working_fcntl_h="no (bad O_NOATIME)"], - [66], [gl_cv_header_working_fcntl_h="no (bad O_NOFOLLOW, O_NOATIME)"], + [67], [gl_cv_header_working_fcntl_h="no (bad O_NOFOLLOW, O_NOATIME)"], [68], [gl_cv_header_working_fcntl_h="no (bad O_DIRECTORY, O_NOATIME)"], - [70], [gl_cv_header_working_fcntl_h="no (bad O_NOFOLLOW, O_DIRECTORY, O_NOATIME)"], + [71], [gl_cv_header_working_fcntl_h="no (bad O_NOFOLLOW, O_DIRECTORY, O_NOATIME)"], [gl_cv_header_working_fcntl_h="no"])], [AS_CASE([$host_os,$gl_cross_guess_normal], # The O_DIRECTORY test is known to fail on Mac OS X 10.4.11 (2007)