Stubs for uuid_* on android to at leas allow linking the adapter keysync
authorEdouard Tisserant
Fri, 02 Sep 2016 01:32:22 +0200
branchkeysync
changeset 111997f329284202
parent 1118 df6c0c9aa76a
child 1120 277b32596365
Stubs for uuid_* on android to at leas allow linking the adapter
src/platform_unix.c
src/platform_unix.h
     1.1 --- a/src/platform_unix.c	Thu Sep 01 14:16:18 2016 +0200
     1.2 +++ b/src/platform_unix.c	Fri Sep 02 01:32:22 2016 +0200
     1.3 @@ -23,6 +23,7 @@
     1.4  #endif
     1.5  
     1.6  #ifdef ANDROID
     1.7 +#include <uuid.h>
     1.8  char *stpncpy(char *dst, const char *src, size_t n)
     1.9  {
    1.10      if (n != 0) {
    1.11 @@ -95,6 +96,17 @@
    1.12      }
    1.13      return buffer;
    1.14  }
    1.15 +
    1.16 +void uuid_generate_random(uuid__t out)
    1.17 +{
    1.18 +    // TODO
    1.19 +}
    1.20 +
    1.21 +void uuid_unparse_upper(uuid__t uu, uuid_string_t out)
    1.22 +{
    1.23 +    // TODO
    1.24 +}
    1.25 +
    1.26  #endif
    1.27  
    1.28  #if !defined(BSD) && !defined(__APPLE__)
     2.1 --- a/src/platform_unix.h	Thu Sep 01 14:16:18 2016 +0200
     2.2 +++ b/src/platform_unix.h	Fri Sep 02 01:32:22 2016 +0200
     2.3 @@ -9,8 +9,6 @@
     2.4  
     2.5  #ifndef ANDROID
     2.6  #include <uuid/uuid.h>
     2.7 -#else
     2.8 -#include <linux/uuid.h>
     2.9  #endif
    2.10  
    2.11  
    2.12 @@ -72,6 +70,12 @@
    2.13  // on *nix, uuid_t is an array and already implements pointer semantics
    2.14  #define UUID uuid_t
    2.15  
    2.16 +#ifdef ANDROID
    2.17 +typedef char uuid__t[16];
    2.18 +void uuid_generate_random(uuid__t out);
    2.19 +void uuid_unparse_upper(uuid__t uu, uuid_string_t out);
    2.20 +#endif
    2.21 +
    2.22  #ifdef __cplusplus
    2.23  }
    2.24  #endif