MCPcopy Create free account
hub / github.com/numpy/numpy / check_restrict

Function check_restrict

numpy/distutils/command/autodist.py:31–46  ·  view source on GitHub ↗

Return the restrict identifier (may be empty).

(cmd)

Source from the content-addressed store, hash-verified

29
30
31def check_restrict(cmd):
32 """Return the restrict identifier (may be empty)."""
33 cmd._check_compiler()
34 body = textwrap.dedent("""
35 static int static_func (char * %(restrict)s a)
36 {
37 return 0;
38 }
39 """)
40
41 for kw in ['restrict', '__restrict__', '__restrict']:
42 st = cmd.try_compile(body % {'restrict': kw}, None, None)
43 if st:
44 return kw
45
46 return ''
47
48
49def check_compiler_gcc(cmd):

Callers 1

check_restrictMethod · 0.90

Calls 1

_check_compilerMethod · 0.80

Tested by

no test coverage detected