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