annotate src/libsndfile-1.0.25/M4/flexible_array.m4 @ 0:c7265573341e

Import initial set of sources
author Chris Cannam
date Mon, 18 Mar 2013 14:12:14 +0000
parents
children
rev   line source
Chris@0 1 dnl @synopsis MN_C99_FLEXIBLE_ARRAY
Chris@0 2 dnl
Chris@0 3 dnl Dose the compiler support the 1999 ISO C Standard "stuct hack".
Chris@0 4 dnl @version 1.1 Mar 15 2004
Chris@0 5 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
Chris@0 6 dnl
Chris@0 7 dnl Permission to use, copy, modify, distribute, and sell this file for any
Chris@0 8 dnl purpose is hereby granted without fee, provided that the above copyright
Chris@0 9 dnl and this permission notice appear in all copies. No representations are
Chris@0 10 dnl made about the suitability of this software for any purpose. It is
Chris@0 11 dnl provided "as is" without express or implied warranty.
Chris@0 12
Chris@0 13 AC_DEFUN([MN_C99_FLEXIBLE_ARRAY],
Chris@0 14 [AC_CACHE_CHECK(C99 struct flexible array support,
Chris@0 15 ac_cv_c99_flexible_array,
Chris@0 16
Chris@0 17 # Initialize to unknown
Chris@0 18 ac_cv_c99_flexible_array=no
Chris@0 19
Chris@0 20 AC_TRY_LINK([[
Chris@0 21 #include <stdlib.h>
Chris@0 22 typedef struct {
Chris@0 23 int k;
Chris@0 24 char buffer [] ;
Chris@0 25 } MY_STRUCT ;
Chris@0 26 ]],
Chris@0 27 [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ],
Chris@0 28 ac_cv_c99_flexible_array=yes,
Chris@0 29 ac_cv_c99_flexible_array=no
Chris@0 30 ))]
Chris@0 31 ) # MN_C99_FLEXIBLE_ARRAY
Chris@0 32