diff options
author | David Cournapeau <cournape@gmail.com> | 2009-03-11 06:38:42 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-03-11 06:38:42 +0000 |
commit | 354e0ebb14530307b1f1c6b6ae38e3cfc05f364b (patch) | |
tree | 610f07ad6e62b085d9143d1177f341d61dfbbb49 /numpy/distutils/command/autodist.py | |
parent | 523a237e73e03636dab96df9856babde479438e6 (diff) | |
download | numpy-354e0ebb14530307b1f1c6b6ae38e3cfc05f364b.tar.gz |
Add check for (C) inline.
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 '' |