diff --git a/src/core/stdc/fenv.d b/src/core/stdc/fenv.d index 37db25904e3..6b07e0994c6 100644 --- a/src/core/stdc/fenv.d +++ b/src/core/stdc/fenv.d @@ -116,17 +116,24 @@ else version ( FreeBSD ) } else version( Android ) { - struct fenv_t + version(X86) { - ushort __control; - ushort __mxcsr_hi; - ushort __status; - ushort __mxcsr_lo; - uint __tag; - byte[16] __other; + struct fenv_t + { + ushort __control; + ushort __mxcsr_hi; + ushort __status; + ushort __mxcsr_lo; + uint __tag; + byte[16] __other; + } + + alias ushort fexcept_t; + } + else + { + static assert(false, "Architecture not supported."); } - - alias ushort fexcept_t; } else { diff --git a/src/core/stdc/stdio.d b/src/core/stdc/stdio.d index 4489b793c5c..999776cb997 100644 --- a/src/core/stdc/stdio.d +++ b/src/core/stdc/stdio.d @@ -26,6 +26,10 @@ private { import core.sys.posix.sys.types; } + else version (Android) + { + import core.sys.posix.sys.types; + } } extern (C): @@ -235,6 +239,8 @@ else version( linux ) } else version( OSX ) { + alias int fpos_t; + align (1) struct _iobuf { ubyte* _p; @@ -265,6 +271,8 @@ else version( OSX ) } else version( FreeBSD ) { + alias int fpos_t; + align (1) struct _iobuf { ubyte* _p; @@ -319,6 +327,8 @@ else version (Solaris) } else version( Android ) { + alias off_t fpos_t; + align(1) struct _iobuf { ubyte* _p; @@ -515,8 +525,6 @@ else static assert( false, "Unsupported platform" ); } -alias int fpos_t; - int remove(in char* filename); int rename(in char* from, in char* to); diff --git a/src/core/sys/posix/sys/types.d b/src/core/sys/posix/sys/types.d index 0b89c4778d0..bb490651c61 100644 --- a/src/core/sys/posix/sys/types.d +++ b/src/core/sys/posix/sys/types.d @@ -176,6 +176,28 @@ else version (Solaris) alias c_long time_t; alias uint uid_t; } +else version( Android ) +{ + version(X86) + { + alias ulong blkcnt_t; + alias ulong blksize_t; + alias uint dev_t; + alias uint gid_t; + alias ulong ino_t; + alias ushort mode_t; + alias ushort nlink_t; + alias long off_t; + alias int pid_t; + alias long ssize_t; + alias long time_t; + alias uint uid_t; + } + else + { + static assert(false, "Architecture not supported."); + } +} else { static assert(false, "Unsupported platform"); @@ -257,6 +279,23 @@ else version (Solaris) alias id_t zoneid_t; alias id_t ctid_t; } +else version( Android ) +{ + version(X86) + { + alias ulong fsblkcnt_t; + alias ulong fsfilcnt_t; + alias long clock_t; + alias uint id_t; + alias int key_t; + alias long suseconds_t; + alias long useconds_t; + } + else + { + static assert(false, "Architecture not supported."); + } +} else { static assert(false, "Unsupported platform"); @@ -688,6 +727,55 @@ else version (Solaris) alias uint pthread_key_t; } +else version( Android ) +{ + version(X86) + { + struct pthread_attr_t + { + uint flags; + void* stack_base; + size_t stack_size; + size_t guard_size; + int sched_policy; + int sched_priority; + } + } + else + { + static assert(false, "Architecture not supported."); + } + + struct pthread_cond_t + { + int value; //volatile + } + + alias long pthread_condattr_t; + alias int pthread_key_t; + + struct pthread_mutex_t + { + int value; //volatile + } + + alias long pthread_mutexattr_t; + alias int pthread_once_t; //volatile + + struct pthread_rwlock_t + { + pthread_mutex_t lock; + pthread_cond_t cond; + int numLocks; + int writerThreadId; + int pendingReaders; + int pendingWriters; + void*[4] reserved; + } + + alias int pthread_rwlockattr_t; + alias long pthread_t; +} else { static assert(false, "Unsupported platform"); @@ -740,6 +828,9 @@ else version (Solaris) void* __pthread_barrierattrp; } } +else version( Android ) +{ +} else { static assert(false, "Unsupported platform");