diff options
Diffstat (limited to 'numpy/distutils/command/autodist.py')
-rw-r--r-- | numpy/distutils/command/autodist.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/numpy/distutils/command/autodist.py b/numpy/distutils/command/autodist.py new file mode 100644 index 000000000..f246eb9f9 --- /dev/null +++ b/numpy/distutils/command/autodist.py @@ -0,0 +1,25 @@ +"""This module implements additional tests ala autoconf which can be useful.""" + +# We put them here since they could be easily reused outside numpy.distutils + +def check_inline(cmd): + """Return the inline identifier (may be empty).""" + cmd._check_compiler() + body = """ +#ifndef __cplusplus +static %(inline)s int static_func (void) +{ + return 0; +} +%(inline)s int nostatic_func (void) +{ + return 0; +} +#endif""" + + for kw in ['inline', '__inline__', '__inline']: + st = cmd.try_compile(body % {'inline': kw}, None, None) + if st: + return kw + + return '' |