Chris@40: dnl @synopsis MN_C99_FLEXIBLE_ARRAY Chris@40: dnl Chris@40: dnl Dose the compiler support the 1999 ISO C Standard "stuct hack". Chris@40: dnl @version 1.1 Mar 15 2004 Chris@40: dnl @author Erik de Castro Lopo Chris@40: dnl Chris@40: dnl Permission to use, copy, modify, distribute, and sell this file for any Chris@40: dnl purpose is hereby granted without fee, provided that the above copyright Chris@40: dnl and this permission notice appear in all copies. No representations are Chris@40: dnl made about the suitability of this software for any purpose. It is Chris@40: dnl provided "as is" without express or implied warranty. Chris@40: Chris@40: AC_DEFUN([MN_C99_FLEXIBLE_ARRAY], Chris@40: [AC_CACHE_CHECK(C99 struct flexible array support, Chris@40: ac_cv_c99_flexible_array, Chris@40: Chris@40: # Initialize to unknown Chris@40: ac_cv_c99_flexible_array=no Chris@40: Chris@40: AC_TRY_LINK([[ Chris@40: #include Chris@40: typedef struct { Chris@40: int k; Chris@40: char buffer [] ; Chris@40: } MY_STRUCT ; Chris@40: ]], Chris@40: [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ], Chris@40: ac_cv_c99_flexible_array=yes, Chris@40: ac_cv_c99_flexible_array=no Chris@40: ))] Chris@40: ) # MN_C99_FLEXIBLE_ARRAY Chris@40: