[libdvdnav-devel] [Git][videolan/libdvdread][master] dvd_input: remove dead strerror_r configure-time variants

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Wed Jul 29 06:25:10 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdread


Commits:
d68347a3 by Kacper Michajłow at 2026-07-28T15:16:52+02:00
dvd_input: remove dead strerror_r configure-time variants

STRERROR_R_CHAR_P was an autoconf-ism (AC_FUNC_STRERROR_R detecting
the GNU char* signature) that the Meson build never defines, so that
branch has been unreachable since the build system switch. Likewise
HAVE_DECL_STRERROR_R is always set together with HAVE_STRERROR_R and
adds no information.

The build uses -D_DEFAULT_SOURCE without _GNU_SOURCE, so glibc declares
the POSIX int-returning strerror_r and the surviving branch is the one
that was already taken.

- - - - -


2 changed files:

- meson.build
- src/dvd_input.c


Changes:

=====================================
meson.build
=====================================
@@ -78,7 +78,6 @@ endif
 
 if cc.has_function('strerror_r', prefix: '#include <string.h>', args: test_args)
     cdata.set('HAVE_STRERROR_R', 1)
-    cdata.set('HAVE_DECL_STRERROR_R', 1)
 elif cc.has_function('strerror_s', prefix: '#include <string.h>', args: test_args)
     cdata.set('HAVE_STRERROR_S', 1)
 endif


=====================================
src/dvd_input.c
=====================================
@@ -281,22 +281,14 @@ static dvd_input_t file_open(void *priv, dvd_logger_cb *logcb,
   dev->file = fs->file_open(fs, target);
   if(!dev->file) {
     char buf[256];
-#if defined(HAVE_STRERROR_R) && defined(HAVE_DECL_STRERROR_R)
-  #ifdef STRERROR_R_CHAR_P
-    *buf=0;
-    if(strerror_r(errno, buf, 256) == NULL)
-        *buf=0;
-  #else
+#if defined(HAVE_STRERROR_R)
     if(strerror_r(errno, buf, 256) != 0)
         *buf=0;
-  #endif
+#elif defined(HAVE_STRERROR_S)
+    if(strerror_s(buf, 256, errno) != 0)
+        *buf=0;
 #else
- #if defined(HAVE_STRERROR_S)
-   if(strerror_s(buf, 256, errno) != 0)
-     *buf=0;
-  #else
     *buf=0;
-  #endif
 #endif
     DVDReadLog(priv, logcb, DVD_LOGGER_LEVEL_ERROR,
                "Could not open input: %s", buf);



View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/commit/d68347a3075b10ad22dd2d46c65490b8e7f1cdff

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/commit/d68347a3075b10ad22dd2d46c65490b8e7f1cdff
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the libdvdnav-devel mailing list