Return the restrict identifier (may be empty).
(cmd)
| 29 | |
| 30 | |
| 31 | def 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 | |
| 49 | def check_compiler_gcc(cmd): |
no test coverage detected