Mercurial > vim
comparison src/configure.ac @ 13716:30f9ebe3e602 v8.0.1730
patch 8.0.1730: no configure check for the used C99 features
commit https://github.com/vim/vim/commit/561f8a5a4612751c2a4ebd6bf918cbc3be867350
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 17 22:02:45 2018 +0200
patch 8.0.1730: no configure check for the used C99 features
Problem: No configure check for the used C99 features.
Solution: Add a compilation check. Tentatively document C99 features.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 17 Apr 2018 22:15:07 +0200 |
parents | 7152032191d7 |
children | d35b1702a1da |
comparison
equal
deleted
inserted
replaced
13715:9e68fff0070f | 13716:30f9ebe3e602 |
---|---|
26 | 26 |
27 dnl Check for standard headers. We don't use this in Vim but other stuff | 27 dnl Check for standard headers. We don't use this in Vim but other stuff |
28 dnl in autoconf needs it, where it uses STDC_HEADERS. | 28 dnl in autoconf needs it, where it uses STDC_HEADERS. |
29 AC_HEADER_STDC | 29 AC_HEADER_STDC |
30 AC_HEADER_SYS_WAIT | 30 AC_HEADER_SYS_WAIT |
31 | |
32 dnl Check that the C99 features that Vim uses are supported: | |
33 dnl - // commands | |
34 dnl - comma after last enum item | |
35 dnl - "long long int" and "long long unsigned" | |
36 dnl - flexible array member | |
37 AC_MSG_CHECKING(if the compiler can handle Vim code) | |
38 AC_TRY_COMPILE([#include <stdio.h>], [ | |
39 struct with_flexible_member { | |
40 int count; // comment | |
41 char text[]; // another comment | |
42 }; | |
43 enum { | |
44 one, | |
45 two, | |
46 three, | |
47 }; | |
48 long long int a = 1; | |
49 long long unsigned b = 2; | |
50 printf("a %lld and a %llu", a, b); | |
51 ], | |
52 AC_MSG_RESULT(yes), | |
53 AC_MSG_ERROR([compiler does not work properly - see auto/config.log])) | |
31 | 54 |
32 dnl Check for the flag that fails if stuff are missing. | 55 dnl Check for the flag that fails if stuff are missing. |
33 | 56 |
34 AC_MSG_CHECKING(--enable-fail-if-missing argument) | 57 AC_MSG_CHECKING(--enable-fail-if-missing argument) |
35 AC_ARG_ENABLE(fail_if_missing, | 58 AC_ARG_ENABLE(fail_if_missing, |