diff options
author | wm4 <wm4@nowhere> | 2014-11-17 21:22:21 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-17 21:22:21 +0100 |
commit | 2f9467cfd2574af44f97ee89b460c410a5a3c85a (patch) | |
tree | 2ae50d584c136b84778cff4429ec9dbddf780d6d /libass/ass_utils.h | |
parent | 0c0b3f57aa688f3d2b38c5faf8178dad45302aa0 (diff) | |
download | libass-2f9467cfd2574af44f97ee89b460c410a5a3c85a.tar.bz2 libass-2f9467cfd2574af44f97ee89b460c410a5a3c85a.tar.xz |
Provide a strndup() fallback
This standard function is not available everywhere, so we detect it and
provide a fallback if missing.
Diffstat (limited to 'libass/ass_utils.h')
-rw-r--r-- | libass/ass_utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libass/ass_utils.h b/libass/ass_utils.h index 1ce451cc..579ac406 100644 --- a/libass/ass_utils.h +++ b/libass/ass_utils.h @@ -27,6 +27,8 @@ #include <assert.h> #include <errno.h> +#include "config.h" + #ifdef CONFIG_ENCA #include <enca.h> #endif @@ -54,6 +56,11 @@ int has_avx(void); int has_avx2(void); #endif +#ifndef HAVE_STRNDUP +char *ass_strndup(const char *s, size_t n); +#define strndup ass_strndup +#endif + void *ass_aligned_alloc(size_t alignment, size_t size); void ass_aligned_free(void *ptr); |