0010-static-assert.patch 868 B

12345678910111213141516171819202122232425
  1. From: Thomas Guillem <thomas@gllm.fr>
  2. Date: Thu, 30 Apr 2015 13:29:50 +0000 (+0200)
  3. Subject: Fix build when using C99 and C++11
  4. X-Git-Url: http://git.videolan.org/?p=vlc.git;a=commitdiff_plain;h=51ce6cdaf598754e617900994c1943c6cba6d604
  5. Fix build when using C99 and C++11
  6. Indeed, C99 doesn't have static_assert and C++11 has it.
  7. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  8. ---
  9. diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
  10. index b949d24..ee168d7 100644
  11. --- a/include/vlc_fixups.h
  12. +++ b/include/vlc_fixups.h
  13. @@ -239,7 +239,7 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base)
  14. }
  15. #endif
  16. -#if !defined (HAVE_STATIC_ASSERT)
  17. +#if !defined (HAVE_STATIC_ASSERT) && !defined(__cpp_static_assert)
  18. # define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); }))
  19. # define static_assert _Static_assert
  20. #endif