Fixes for missing entries in android libc
authorEdouard Tisserant
Fri, 21 Aug 2015 17:12:59 +0200
changeset 338962f6656d2c8
parent 337 ea7d347eaf6c
child 339 a6485dc4f7af
Fixes for missing entries in android libc
src/platform_unix.c
src/platform_unix.h
     1.1 --- a/src/platform_unix.c	Thu Aug 20 11:58:05 2015 +0200
     1.2 +++ b/src/platform_unix.c	Fri Aug 21 17:12:59 2015 +0200
     1.3 @@ -39,6 +39,23 @@
     1.4      return (dst);
     1.5  }
     1.6  
     1.7 +#ifdef ANDROID
     1.8 +char *stpcpy(char *dst, const char *src)
     1.9 +{
    1.10 +    for (;; ++dst, ++src) {
    1.11 +        *dst = *src;
    1.12 +        if (*dst == 0)
    1.13 +            break;
    1.14 +    }
    1.15 +    return dst;
    1.16 +}
    1.17 +
    1.18 +long int random(void){
    1.19 +  unsigned short xsubi[3] = {'p', 'E', 'p'};
    1.20 +  return nrand48(xsubi);
    1.21 +}
    1.22 +#endif
    1.23 +
    1.24  const char *unix_local_db(void)
    1.25  {
    1.26      static char buffer[MAX_PATH];
     2.1 --- a/src/platform_unix.h	Thu Aug 20 11:58:05 2015 +0200
     2.2 +++ b/src/platform_unix.h	Fri Aug 21 17:12:59 2015 +0200
     2.3 @@ -12,6 +12,11 @@
     2.4  const char *gpg_conf(void);
     2.5  const char *gpg_home(void);
     2.6  
     2.7 +#ifdef ANDROID
     2.8 +char *stpcpy(char *dst, const char *src);
     2.9 +long int random(void);
    2.10 +#endif
    2.11 +
    2.12  #ifdef __cplusplus
    2.13  }
    2.14  #endif