summaryrefslogtreecommitdiffstats
path: root/src/configure.ac
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-04-17 22:02:45 +0200
committerBram Moolenaar <Bram@vim.org>2018-04-17 22:02:45 +0200
commit561f8a5a4612751c2a4ebd6bf918cbc3be867350 (patch)
tree7842c46ff65ffe1b1367e001cea0f0b3bfd5340c /src/configure.ac
parentea3ece405ab55f44018257bd2f5021231af8e87f (diff)
patch 8.0.1730: no configure check for the used C99 featuresv8.0.1730
Problem: No configure check for the used C99 features. Solution: Add a compilation check. Tentatively document C99 features.
Diffstat (limited to 'src/configure.ac')
-rw-r--r--src/configure.ac23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/configure.ac b/src/configure.ac
index e37a26790f..4ae21a110e 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -29,6 +29,29 @@ dnl in autoconf needs it, where it uses STDC_HEADERS.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
+dnl Check that the C99 features that Vim uses are supported:
+dnl - // commands
+dnl - comma after last enum item
+dnl - "long long int" and "long long unsigned"
+dnl - flexible array member
+AC_MSG_CHECKING(if the compiler can handle Vim code)
+AC_TRY_COMPILE([#include <stdio.h>], [
+ struct with_flexible_member {
+ int count; // comment
+ char text[]; // another comment
+ };
+ enum {
+ one,
+ two,
+ three,
+ };
+ long long int a = 1;
+ long long unsigned b = 2;
+ printf("a %lld and a %llu", a, b);
+ ],
+AC_MSG_RESULT(yes),
+AC_MSG_ERROR([compiler does not work properly - see auto/config.log]))
+
dnl Check for the flag that fails if stuff are missing.
AC_MSG_CHECKING(--enable-fail-if-missing argument)