hardware icon indicating copy to clipboard operation
hardware copied to clipboard

Add support for Mac

Open bararchy opened this issue 7 years ago • 3 comments

Right now the shard was tested, built and ran only on Linux, but we should let the Mac guys in on the fun :)

Suggested way to do it is by having compile time OS specific code wrapped so that the program can be used in different operating systems.

For example (from crystal repo)

{% if flag?(:freebsd) || flag?(:openbsd) %}
  require "./system/unix/sysctl_cpucount"
{% elsif flag?(:unix) %}
  require "./system/unix/sysconf_cpucount"
{% end %}

bararchy avatar Apr 25 '18 07:04 bararchy

Using macros is the way to go. I think also it would be good to put each platform specific implementation in its directory like linux, bsd... and of course keeping the same API.

j8r avatar Apr 25 '18 21:04 j8r

+1 for mac support

fridgerator avatar Oct 16 '18 18:10 fridgerator

+1 for Mac Should be more generic rather using /proc/meminfo Also, working not on every Linux

Dmdv avatar Jan 17 '22 09:01 Dmdv