File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
2
- from ./ csyms import SIZEOF_RLIMIT_T
2
+ from ./ csyms import SIZEOF_RLIMIT_T, RUSAGE_BOTH, RUSAGE_THREAD
3
3
4
4
const RLIM_INFINITY* =
5
5
when SIZEOF_RLIMIT_T == 8 :
@@ -13,6 +13,9 @@ template wrap(name){.dirty.} =
13
13
template wrap(name, os){.dirty.} =
14
14
when defined(os):
15
15
wrap(name)
16
+ template wrapIfE(name){.dirty.} =
17
+ when declared(name) and name != low(int ):
18
+ const name* = int name
16
19
17
20
wrap(RLIMIT_CORE)
18
21
wrap(RLIMIT_CPU)
@@ -40,5 +43,5 @@ when defined(freebsd):
40
43
41
44
wrap(RUSAGE_SELF)
42
45
wrap(RUSAGE_CHILDREN)
43
- wrap (RUSAGE_BOTH)
44
- wrap (RUSAGE_THREAD)
46
+ wrapIfE (RUSAGE_BOTH)
47
+ wrapIfE (RUSAGE_THREAD)
Original file line number Diff line number Diff line change 1
1
2
2
import ./ util
3
3
4
+ const
5
+ RUSAGE_BOTH* = from_c_int(RUSAGE_BOTH, " <sys/resource.h>" )
6
+ RUSAGE_THREAD* = from_c_int(RUSAGE_THREAD, " <sys/resource.h>" )
7
+
4
8
const SIZEOF_RLIMIT_T* = from_c_int(SIZEOF_RLIMIT_T, 8 ):
5
9
{.emit: """ /*INCLUDESECTION*/
6
10
#include <sys/resource.h>
You can’t perform that action at this time.
0 commit comments