Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
ce150f38
Commit
ce150f38
authored
Jun 22, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configure: test and enable C11 where available
parent
d3b892b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
configure.ac
configure.ac
+1
-0
m4/c11.m4
m4/c11.m4
+44
-0
No files found.
configure.ac
View file @
ce150f38
...
...
@@ -45,6 +45,7 @@ dnl Check for tools
dnl
AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS
VLC_PROG_CC_C11
AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
AH_TOP([
...
...
m4/c11.m4
0 → 100644
View file @
ce150f38
# Copyright © 2015 Rémi Denis-Courmont
# This file (c11.m4) is free software; unlimited permission to
# copy and/or distribute it , with or without modifications, as long
# as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
AC_DEFUN([VLC_PROG_CC_C11], [
AC_LANG_ASSERT(C)
for opt in "" -std=gnu11 -std=c11 -c11
do
cachevar=AS_TR_SH([ax_cv_c_compile_c11_$opt])
AC_CACHE_CHECK([whether $CC $opt supports C11], [$cachevar], [
CFLAGS_save="$CFLAGS"
CFLAGS="$CFLAGS $opt"
dnl PREPROC is not enough due to CFLAGS usage
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
[#ifndef __STDC_VERSION__
# error Not a C compiler!
#endif
#if (__STDC_VERSION__ < 201112L)
# error Too old C compiler!
#endif
_Static_assert(1, "Not C11!");
const int varname = _Generic(1, int: 1, default: 0);
]])], [
eval $cachevar="yes"
], [
eval $cachevar="no"
])
CFLAGS="$CFLAGS_save"
])
if eval test "\$$cachevar" = "yes"
then
CFLAGS="$CFLAGS $opt"
break
fi
done
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment