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