brew/Library/Homebrew/hw.model.c
Max Howell 7cb9c31f3e Determine best optimization flags for host
We call sysctl to determine which exact Mac model we are running on and
optimize as well as possible.
2009-07-31 16:06:14 +01:00

13 lines
227 B
C

#include <sys/sysctl.h>
#include <stdio.h>
int main()
{
char buf[32];
size_t sz = sizeof(buf);
int r = sysctlbyname("hw.model", buf, &sz, NULL, 0);
if (r == 0)
printf("%.*s", sz, buf);
return r;
}