]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix Android NDK compilation error
authorBen Efrati <Ben@Efrati>
Mon, 2 Nov 2015 06:17:58 +0000 (08:17 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 2 Nov 2015 19:20:16 +0000 (20:20 +0100)
src/tvheadend.h

index 5f2dbee94616ce772714c09c0be87352b1ef12fd..918dd8e2c247a60991b89726b9067d76c79712f4 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/*
  *  Tvheadend - structures
  *  Copyright (C) 2007 Andreas Öman
  *
 #include <limits.h>
 #if ENABLE_LOCKOWNER || ENABLE_ANDROID
 #include <sys/syscall.h>
+#if ENABLE_ANDROID
+#ifndef strdupa
+#define strdupa(s)                                                            \
+    ({                                                                        \
+      const char *__old = (s);                                                \
+      size_t __len = strlen(__old) + 1;                                       \
+      char *__new = (char *) alloca(__len);                                   \
+      (char *) memcpy(__new, __old, __len);                                   \
+    })
+#endif
+#endif
 #endif
 #include "queue.h"
 #include "avg.h"