Skip to content

Commit

Permalink
switch to C17
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Feb 6, 2024
1 parent 1d5d67b commit b164a2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dnl Check for tools
dnl
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
VLC_PROG_CC_C11
VLC_PROG_CC_C17
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+ or toolchains predefining _FORTIFY_SOURCE */
Expand Down
14 changes: 7 additions & 7 deletions m4/c11.m4 → m4/c17.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright © 2015 Rémi Denis-Courmont
# This file (c11.m4) is free software; unlimited permission to
# This file (c17.m4) is free software; unlimited permission to
# copy and/or distribute it , with or without modifications, as long
# as this notice is preserved.

Expand All @@ -9,24 +9,24 @@
# PARTICULAR PURPOSE.


AC_DEFUN([VLC_PROG_CC_C11], [
AC_DEFUN([VLC_PROG_CC_C17], [
AC_LANG_ASSERT(C)
for opt in "" -std=gnu11 -std=c11 -c11
for opt in "" -std=gnu17 -std=c17 -c17
do
cachevar=AS_TR_SH([ax_cv_c_compile_c11_$opt])
AC_CACHE_CHECK([whether $CC $opt supports C11], [$cachevar], [
cachevar=AS_TR_SH([ax_cv_c_compile_c17_$opt])
AC_CACHE_CHECK([whether $CC $opt supports C17], [$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)
#if (__STDC_VERSION__ < 201710L)
# error Too old C compiler!
#endif
_Static_assert(1, "Not C11!");
_Static_assert(1, "Not C17!");
const int varname = _Generic(1, int: 1, default: 0);
]])], [
eval $cachevar="yes"
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('VLC', ['c', 'cpp'],
version: '4.0.0-dev',
default_options: ['c_std=gnu11', 'cpp_std=c++17'],
default_options: ['c_std=gnu17', 'cpp_std=c++17'],
meson_version: '>=0.60.0')

vlc_copyright_years = '1996-2018'
Expand Down

0 comments on commit b164a2f

Please sign in to comment.