[vlc-commits] [Git][videolan/vlc][master] 2 commits: diffutil: fix return type

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jan 20 08:54:23 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a6c594bb by Steve Lhomme at 2023-01-20T08:31:24+00:00
diffutil: fix return type

- - - - -
6be0e8af by Steve Lhomme at 2023-01-20T08:31:24+00:00
configure: remove static_assert check

We require C11 support where it's mandatory. Plus we use it later to check
for some function support.

- - - - -


4 changed files:

- configure.ac
- include/vlc_fixups.h
- meson.build
- src/misc/diffutil.c


Changes:

=====================================
configure.ac
=====================================
@@ -751,17 +751,6 @@ dnl mingw64 implements those as static inline, not functions with C linkage
 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
 
-dnl C11 static_assert()
-AC_MSG_CHECKING([for static_assert in assert.h])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
-static_assert(1, "The impossible happened.");
-])], [
-  AC_MSG_RESULT([yes])
-  AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
-], [
-  AC_MSG_RESULT([no])
-])
-
 # Windows CE does not have strcoll()
 AC_FUNC_STRCOLL
 


=====================================
include/vlc_fixups.h
=====================================
@@ -388,13 +388,6 @@ static inline locale_t uselocale(locale_t loc)
 }
 #endif
 
-#if !defined (HAVE_STATIC_ASSERT) && !defined(__cpp_static_assert)
-# define STATIC_ASSERT_CONCAT_(a, b) a##b
-# define STATIC_ASSERT_CONCAT(a, b) STATIC_ASSERT_CONCAT_(a, b)
-# define _Static_assert(x, s) extern char STATIC_ASSERT_CONCAT(static_assert_, __LINE__)[sizeof(struct { unsigned:-!(x); })]
-# define static_assert _Static_assert
-#endif
-
 /* libintl support */
 #define _(str)            vlc_gettext (str)
 #define N_(str)           gettext_noop (str)


=====================================
meson.build
=====================================
@@ -819,11 +819,6 @@ if cpp.has_type('locale_t', prefix: '#include <locale>')
     cdata.set('HAVE_CXX_LOCALE_T', 1)
 endif
 
-# Check if assert.h has static_assert
-if cc.has_header_symbol('assert.h', 'static_assert')
-    cdata.set('HAVE_STATIC_ASSERT', 1)
-endif
-
 # Check if build machine is big endian
 if build_machine.endian() == 'big'
     cdata.set('WORDS_BIGENDIAN', 1)


=====================================
src/misc/diffutil.c
=====================================
@@ -163,7 +163,7 @@ static bool FindMidPoint(diffutil_context_t* ctx, const diffutil_box_t* box, dif
     assert(box != NULL);
     int boxSize = box->size;
     if (boxSize == 0)
-        return NULL;
+        return false;
 
     int boxmax = (boxSize + 1) / 2;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/cac3057f62da3bee9efe1c462030438bb5ba2cb4...6be0e8af6b424e9111ffbf276e666164335e9eab

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/cac3057f62da3bee9efe1c462030438bb5ba2cb4...6be0e8af6b424e9111ffbf276e666164335e9eab
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list