D-Programming-Language/druntime — pull request #796 by joakim-noah (2014-05-20 11:10:24+00:00)
Title: WIP: Odds and ends for Android

As I work through the phobos unit tests on Android/x86, a couple more bits to add to druntime. I'll keep updating this pull as I go, I'll remove the WIP tag when it's ready for review and merging.

Since Android defines `long double` as 64 bits on x86 and ARM, same as `double`, and doesn't provide many math functions that operate on `long double`, I've added a section for Android in `core.stdc.math` with its own list of math functions, with many of the `long double` functions stubbed out from the full Posix list. However, `std.math` in phobos calls 12 `long double` functions, one from the unit tests, so I've aliased those 12 to the `double` functions. This may not really work unless `real` is 64 bits, as ldc/gdc can do.

Since the treap container was added recently, it uses `rand` and `srand` in its unit tests, which are aliases to `lrand48` and `srand48` in Android. I imported those from `core.sys.posix.stdlib`, not sure if that's the best way to do it.

The `S_ISTYPE` macros from the headers had the wrong type, they don't operate on `mod_t` on Android. Fixed that, plus some small tweaks in sections_android.