Skip to content

Commit a8f32d4

Browse files
melvyn2ReplayCoding
authored andcommitted
Fix sysctl.h usage
1 parent b1f9e77 commit a8f32d4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/tier0/cpu_posix.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
#include <stdio.h>
88
#include <stdlib.h>
99
#include <sys/types.h>
10-
#include <sys/sysctl.h>
1110
#include <sys/time.h>
1211
#include <unistd.h>
1312
#include <tier0/platform.h>
1413
#include <errno.h>
1514

15+
#ifdef OSX
16+
#include <sys/sysctl.h>
17+
#endif
18+
1619
#define rdtsc(x) \
1720
__asm__ __volatile__ ("rdtsc" : "=A" (x))
1821

src/togl/linuxwin/glmgrbasics.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -2627,8 +2627,10 @@ bool GLMDetectOGLP( void )
26272627
#endif
26282628
#include <sys/types.h>
26292629
#ifndef _WIN32
2630-
#include <unistd.h>
2631-
#include <sys/sysctl.h>
2630+
#include <unistd.h>
2631+
#endif
2632+
#ifdef OSX
2633+
#include <sys/sysctl.h>
26322634
#endif
26332635

26342636
// From Technical Q&A QA1361

0 commit comments

Comments
 (0)