GetDLLSuffix: Remove the leading dot from LTDL_SHLIB_EXT.
[oota-llvm.git] / lib / System / Unix / Process.inc
index d7155852bf2aa5de55ffc2b82c80b222d82252b1..cf6a47a31c80d33b72fc2f525c23f6e3a0b9d15a 100644 (file)
@@ -18,7 +18,9 @@
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
-#ifdef HAVE_MALLOC_H
+// DragonFly BSD has deprecated <malloc.h> for <stdlib.h> instead,
+//  Unix.h includes this for us already.
+#if defined(HAVE_MALLOC_H) && !defined(__DragonFly__)
 #include <malloc.h>
 #endif
 #ifdef HAVE_MALLOC_MALLOC_H
@@ -91,7 +93,7 @@ Process::GetTotalMemoryUsage()
   malloc_statistics_t Stats;
   malloc_zone_statistics(malloc_default_zone(), &Stats);
   return Stats.size_allocated;   // darwin
-#elif defined(HAVE_GETRUSAGE)
+#elif defined(HAVE_GETRUSAGE) && !defined(__HAIKU__)
   struct rusage usage;
   ::getrusage(RUSAGE_SELF, &usage);
   return usage.ru_maxrss;
@@ -275,7 +277,7 @@ bool Process::ColorNeedsFlush() {
     COLOR(FGBG, "7", BOLD)\
   }
 
-static const char* colorcodes[2][2][8] = {
+static const char colorcodes[2][2][8][10] = {
  { ALLCOLORS("3",""), ALLCOLORS("3","1;") },
  { ALLCOLORS("4",""), ALLCOLORS("4","1;") }
 };