File tree 2 files changed +45
-0
lines changed
2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ dnl Check for tools
45
45
dnl
46
46
AC_PROG_CC_C99
47
47
AC_USE_SYSTEM_EXTENSIONS
48
+ VLC_PROG_CC_C11
48
49
AC_DEFINE ( [ _FORTIFY_SOURCE] , 2 , [ Define to 2 to get glibc warnings.] )
49
50
AC_DEFINE ( [ _FILE_OFFSET_BITS] , 64 , [ Define to 64 for large files support.] )
50
51
AH_TOP ( [
Original file line number Diff line number Diff line change
1
+ # Copyright © 2015 Rémi Denis-Courmont
2
+ # This file (c11.m4) is free software; unlimited permission to
3
+ # copy and/or distribute it , with or without modifications, as long
4
+ # as this notice is preserved.
5
+
6
+ # This program is distributed in the hope that it will be useful,
7
+ # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
8
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
9
+ # PARTICULAR PURPOSE.
10
+
11
+
12
+ AC_DEFUN ( [ VLC_PROG_CC_C11] , [
13
+ AC_LANG_ASSERT ( C )
14
+
15
+ for opt in "" -std=gnu11 -std=c11 -c11
16
+ do
17
+ cachevar=AS_TR_SH ( [ ax_cv_c_compile_c11_$opt] )
18
+ AC_CACHE_CHECK ( [ whether $CC $opt supports C11] , [ $cachevar] , [
19
+ CFLAGS_save="$CFLAGS"
20
+ CFLAGS="$CFLAGS $opt"
21
+ dnl PREPROC is not enough due to CFLAGS usage
22
+ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [
23
+ [ #ifndef __STDC_VERSION__
24
+ # error Not a C compiler!
25
+ #endif
26
+ #if (__STDC_VERSION__ < 201112L)
27
+ # error Too old C compiler!
28
+ #endif
29
+ _Static_assert(1, "Not C11!");
30
+ const int varname = _Generic(1, int: 1, default: 0);
31
+ ] ] ) ] , [
32
+ eval $cachevar="yes"
33
+ ] , [
34
+ eval $cachevar="no"
35
+ ] )
36
+ CFLAGS="$CFLAGS_save"
37
+ ] )
38
+ if eval test "\$$cachevar" = "yes"
39
+ then
40
+ CFLAGS="$CFLAGS $opt"
41
+ break
42
+ fi
43
+ done
44
+ ] )
You can’t perform that action at this time.
0 commit comments