diff options
author | Peter Powell <petpow@saberuk.com> | 2018-03-13 19:31:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 19:31:43 +0000 |
commit | 017e23fb61cdda7f92ca175b7afba5da5f78bd36 (patch) | |
tree | b6b3a5d7deb44408b9189e9ad2e9d93ea6817194 | |
parent | 27e92622b5655c3ecf3182bc511adfb8a07b8722 (diff) | |
parent | 56a1ef63e7f2628ad92a5040b3acae64cd99b56a (diff) |
Merge pull request #1461 from puckipedia/haiku-support
Add Haiku support.
-rw-r--r-- | make/template/main.mk | 5 | ||||
-rw-r--r-- | src/coremods/core_stats.cpp | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/make/template/main.mk b/make/template/main.mk index 346989086..f3f2c3cc5 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -81,6 +81,11 @@ ifeq ($(SYSTEM), darwin) CORELDFLAGS = -dynamic -bind_at_load -L. PICLDFLAGS = -fPIC -shared -twolevel_namespace -undefined dynamic_lookup endif +ifeq ($(SYSTEM), haiku) + LDLIBS = -lnetwork -lstdc++ + CORELDFLAGS = -L. + PICLDFLAGS = -fPIC -shared +endif ifndef INSPIRCD_DEBUG INSPIRCD_DEBUG=0 diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp index ef6a12d34..878ea2fae 100644 --- a/src/coremods/core_stats.cpp +++ b/src/coremods/core_stats.cpp @@ -239,12 +239,13 @@ void CommandStats::DoStats(Stats::Context& stats) /* Not sure why we were doing '0' with a RUSAGE_SELF comment rather than just using RUSAGE_SELF -- Om */ if (!getrusage(RUSAGE_SELF,&R)) /* RUSAGE_SELF */ { +#ifndef __HAIKU__ stats.AddRow(249, "Total allocation: "+ConvToStr(R.ru_maxrss)+"K"); stats.AddRow(249, "Signals: "+ConvToStr(R.ru_nsignals)); stats.AddRow(249, "Page faults: "+ConvToStr(R.ru_majflt)); stats.AddRow(249, "Swaps: "+ConvToStr(R.ru_nswap)); stats.AddRow(249, "Context Switches: Voluntary; "+ConvToStr(R.ru_nvcsw)+" Involuntary; "+ConvToStr(R.ru_nivcsw)); - +#endif float n_elapsed = (ServerInstance->Time() - ServerInstance->stats.LastSampled.tv_sec) * 1000000 + (ServerInstance->Time_ns() - ServerInstance->stats.LastSampled.tv_nsec) / 1000; float n_eaten = ((R.ru_utime.tv_sec - ServerInstance->stats.LastCPU.tv_sec) * 1000000 + R.ru_utime.tv_usec - ServerInstance->stats.LastCPU.tv_usec); |