Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
442
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
351690f6
Commit
351690f6
authored
13 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
Provide static_assert() replacement
parent
2b268061
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure.ac
+14
-0
14 additions, 0 deletions
configure.ac
include/vlc_fixups.h
+5
-0
5 additions, 0 deletions
include/vlc_fixups.h
with
19 additions
and
0 deletions
configure.ac
+
14
−
0
View file @
351690f6
...
...
@@ -511,6 +511,20 @@ AC_LINK_IFELSE([
c = NULL;
])],[AC_DEFINE([HAVE_VASPRINTF],[1],[Define to 1 if you have asprintf function])],[AC_LIBOBJ([vasprintf])])
dnl C11 static_assert()
AC_MSG_CHECKING([for static_assert in assert.h])
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <assert.h>
#ifndef static_assert
# error BOOM!
#endif
])], [
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
...
...
This diff is collapsed.
Click to expand it.
include/vlc_fixups.h
+
5
−
0
View file @
351690f6
...
...
@@ -229,6 +229,11 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base)
}
#endif
#if !defined (HAVE_STATIC_ASSERT)
# define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); }))
# define static_assert _Static_assert
#endif
/* Alignment of critical static data structures */
#ifdef ATTRIBUTE_ALIGNED_MAX
# define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment