From 1bf32aad90ef2cedc72c40e71f3f8dd87621bc74 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 16 Apr 2020 16:46:09 +0200 Subject: [PATCH] Chg: android adaptions from @xianglin1998 --- client/deps/cliparser/argtable3.c | 5 +++-- client/deps/jansson/jansson_config.h | 8 ++++++-- client/deps/tinycbor/open_memstream.c | 5 +++-- client/src/ui.c | 6 ++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/client/deps/cliparser/argtable3.c b/client/deps/cliparser/argtable3.c index 3acbce48e..f66c22d6d 100644 --- a/client/deps/cliparser/argtable3.c +++ b/client/deps/cliparser/argtable3.c @@ -83,8 +83,9 @@ enum { EMINCOUNT = 1, EMAXCOUNT, EBADINT, - // The same name define EOVERFLOW in errno.h on windows platform -#ifdef __STDC_WANT_SECURE_LIB__ + +// The same name define EOVERFLOW in errno.h on windows platform or android +#if defined(__STDC_WANT_SECURE_LIB__) || defined(__ANDROID__) || defined(ANDROID) EOVERFLOW_, #else EOVERFLOW, diff --git a/client/deps/jansson/jansson_config.h b/client/deps/jansson/jansson_config.h index b34baa551..92f6ffb25 100644 --- a/client/deps/jansson/jansson_config.h +++ b/client/deps/jansson/jansson_config.h @@ -33,9 +33,13 @@ #define JSON_INTEGER_IS_LONG_LONG 1 /* If locale.h and localeconv() are available, define to 1, - otherwise to 0. */ + otherwise to 0. tips: android don't support localeconv() +*/ +#if defined(__ANDROID__) || defined(ANDROID) +#define JSON_HAVE_LOCALECONV 0 +#else #define JSON_HAVE_LOCALECONV 1 - +#endif /* If __atomic builtins are available they will be used to manage reference counts of json_t. */ #define JSON_HAVE_ATOMIC_BUILTINS 1 diff --git a/client/deps/tinycbor/open_memstream.c b/client/deps/tinycbor/open_memstream.c index 199832461..098bf90fe 100644 --- a/client/deps/tinycbor/open_memstream.c +++ b/client/deps/tinycbor/open_memstream.c @@ -35,7 +35,8 @@ #if defined(__unix__) || defined(__APPLE__) # include #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ || defined(__ANDROID__) || defined(ANDROID) typedef int RetType; typedef int LenType; #elif __GLIBC__ @@ -101,7 +102,7 @@ FILE *open_memstream(char **bufptr, size_t *lenptr) { *bufptr = NULL; *lenptr = 0; -#ifdef __APPLE__ +#ifdef __APPLE__ || defined(__ANDROID__) || defined(ANDROID) return funopen(b, NULL, write_to_buffer, NULL, close_buffer); #elif __GLIBC__ static const cookie_io_functions_t vtable = { diff --git a/client/src/ui.c b/client/src/ui.c index bb3039b05..bd8ed0dce 100644 --- a/client/src/ui.c +++ b/client/src/ui.c @@ -21,15 +21,21 @@ #include // for Mingw readline #include #include + +#ifndef ANDROID #include +#endif + #include #include "util.h" #include "proxmark3.h" // PROXLOG #include "fileutils.h" #include "pm3_cmd.h" + #ifdef _WIN32 # include // _mkdir #endif + #include #include "emojis.h" #include "emojis_alt.h"