Added support for building on MacOS/X
Fixed compiler warnings about signed/unsigned comparisons, unused and shadowed identifiers and use of void * arithmetic
Remove __attribute__((unused)) use for now.

Likely not portable enough. Would need better ifdef code first

Signed-off-by: Andi Kleen <ak@linux.intel.com>