Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Mac #6

Open
bararchy opened this issue Apr 25, 2018 · 3 comments
Open

Add support for Mac #6

bararchy opened this issue Apr 25, 2018 · 3 comments

Comments

@bararchy
Copy link
Collaborator

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 %}
@j8r
Copy link
Collaborator

j8r commented Apr 25, 2018

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.

@fridgerator
Copy link

+1 for mac support

@Dmdv
Copy link

Dmdv commented Jan 17, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants