Move ff_dynarray_add to lavu and make it public.

This commit is contained in:
Anton Khirnov
2011-04-29 17:33:38 +02:00
parent 9ac1bf88c0
commit 35ceaa7376
6 changed files with 36 additions and 26 deletions

View File

@@ -31,20 +31,18 @@ typedef struct AVCodecTag {
unsigned int tag;
} AVCodecTag;
void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem);
#ifdef __GNUC__
#define dynarray_add(tab, nb_ptr, elem)\
do {\
__typeof__(tab) _tab = (tab);\
__typeof__(elem) _elem = (elem);\
(void)sizeof(**_tab == _elem); /* check that types are compatible */\
ff_dynarray_add((intptr_t **)_tab, nb_ptr, (intptr_t)_elem);\
av_dynarray_add(_tab, nb_ptr, _elem);\
} while(0)
#else
#define dynarray_add(tab, nb_ptr, elem)\
do {\
ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\
av_dynarray_add((tab), nb_ptr, (elem));\
} while(0)
#endif