diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-02-06 18:45:35 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-02-06 18:48:36 +1100 |
commit | e092a9f885b97fd57dc85714d5e426ad20b5925e (patch) | |
tree | ac3e17bccfc38390e47cb6311e93ebfdd054b345 | |
parent | 66c5d9490ccfa8a6da71259c4d169ec15c4e2f16 (diff) |
Drop tests for and CPP hackery for C99 struct flexible array feature.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | src/common.h | 11 | ||||
-rw-r--r-- | src/ima_adpcm.c | 6 | ||||
-rw-r--r-- | src/ms_adpcm.c | 6 | ||||
-rw-r--r-- | src/paf.c | 6 |
6 files changed, 9 insertions, 39 deletions
@@ -1,3 +1,9 @@ +2013-02-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com> + + * configure.ac src/common.h src/ima_adpcm.c src/ms_adpcm.c src/paf.c + Drop tests for and #ifdef hackery for C99 struct flexible array feature. + libsndfile assumes the compiler supports most of the ISO C99 standard. + 2013-02-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com> * src/alac.c diff --git a/configure.ac b/configure.ac index 8212645..05f0662 100644 --- a/configure.ac +++ b/configure.ac @@ -81,19 +81,6 @@ AM_CONDITIONAL([LINUX_MINGW_CROSS_TEST], [test "$build_os:$target_os:$host_os:$HAVE_WINE" = "linux-gnu:mingw32msvc:mingw32msvc:yes"]) #==================================================================================== -# Check for support of the struct hack. - -MN_C99_FLEXIBLE_ARRAY - -if test x$ac_cv_c99_flexible_array = xyes ; then - AC_DEFINE([HAVE_FLEXIBLE_ARRAY],1, [Set to 1 if the compile supports the struct hack.]) -else - AC_MSG_WARN([[*** This compiler does not support the 1999 ISO C Standard ***]]) - AC_MSG_WARN([[*** feature known as the flexible array struct member. ***]]) - AC_DEFINE([HAVE_FLEXIBLE_ARRAY],0) - fi - -#==================================================================================== # Couple of initializations here. Fill in real values later. SHLIB_VERSION_ARG="" diff --git a/src/common.h b/src/common.h index b64742e..622c95c 100644 --- a/src/common.h +++ b/src/common.h @@ -211,19 +211,8 @@ typedef struct /* CAF */ unsigned int edit_number ; -#if HAVE_FLEXIBLE_ARRAY /* the per channel peak info */ PEAK_POS peaks [] ; -#else - /* - ** This is not ISO compliant C. It works on some compilers which - ** don't support the ISO standard flexible struct array which is - ** used above. If your compiler doesn't like this I suggest you find - ** youself a 1999 ISO C standards compilant compiler. GCC-3.X is - ** highly recommended. - */ - PEAK_POS peaks [0] ; -#endif } PEAK_INFO ; static inline PEAK_INFO * diff --git a/src/ima_adpcm.c b/src/ima_adpcm.c index ccba5de..0ba4513 100644 --- a/src/ima_adpcm.c +++ b/src/ima_adpcm.c @@ -1,5 +1,5 @@ /* -** Copyright (C) 1999-2012 Erik de Castro Lopo <erikd@mega-nerd.com> +** Copyright (C) 1999-2013 Erik de Castro Lopo <erikd@mega-nerd.com> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU Lesser General Public License as published by @@ -37,11 +37,7 @@ typedef struct IMA_ADPCM_PRIVATE_tag int stepindx [2] ; unsigned char *block ; short *samples ; -#if HAVE_FLEXIBLE_ARRAY short data [] ; /* ISO C99 struct flexible array. */ -#else - short data [0] ; /* This is a hack and might not work. */ -#endif } IMA_ADPCM_PRIVATE ; /*============================================================================================ diff --git a/src/ms_adpcm.c b/src/ms_adpcm.c index 6bb616d..1643ddf 100644 --- a/src/ms_adpcm.c +++ b/src/ms_adpcm.c @@ -1,5 +1,5 @@ /* -** Copyright (C) 1999-2012 Erik de Castro Lopo <erikd@mega-nerd.com> +** Copyright (C) 1999-2013 Erik de Castro Lopo <erikd@mega-nerd.com> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU Lesser General Public License as published by @@ -44,11 +44,7 @@ typedef struct sf_count_t samplecount ; short *samples ; unsigned char *block ; -#if HAVE_FLEXIBLE_ARRAY short dummydata [] ; /* ISO C99 struct flexible array. */ -#else - short dummydata [0] ; /* This is a hack an might not work. */ -#endif } MSADPCM_PRIVATE ; /*============================================================================================ @@ -1,5 +1,5 @@ /* -** Copyright (C) 1999-2012 Erik de Castro Lopo <erikd@mega-nerd.com> +** Copyright (C) 1999-2013 Erik de Castro Lopo <erikd@mega-nerd.com> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU Lesser General Public License as published by @@ -64,11 +64,7 @@ typedef struct sf_count_t sample_count ; int *samples ; unsigned char *block ; -#if HAVE_FLEXIBLE_ARRAY int data [] ; /* ISO C99 struct flexible array. */ -#else - int data [1] ; /* This is a hack and may not work. */ -#endif } PAF24_PRIVATE ; /*------------------------------------------------------------------------------ |