ó
ÿ¼÷Xc           @` sS   d  Z  d d l m Z m Z m Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d S(	   sK   This module implements additional tests ala autoconf which can be useful.

i    (   t   divisiont   absolute_importt   print_functionc         C` sX   |  j  ƒ  d } xA d d d g D]0 } |  j | i | d 6d d ƒ } | r  | Sq  Wd S(   s,   Return the inline identifier (may be empty).sŒ   
#ifndef __cplusplus
static %(inline)s int static_func (void)
{
    return 0;
}
%(inline)s int nostatic_func (void)
{
    return 0;
}
#endift   inlinet
   __inline__t   __inlinet    N(   t   _check_compilert   try_compilet   None(   t   cmdt   bodyt   kwt   st(    (    s?   /tmp/pip-build-2Vcwy8/numpy/numpy/distutils/command/autodist.pyt   check_inline	   s    
 c         C` sX   |  j  ƒ  d } xA d d d g D]0 } |  j | i | d 6d d ƒ } | r  | Sq  Wd S(   s.   Return the restrict identifier (may be empty).sB   
static int static_func (char * %(restrict)s a)
{
    return 0;
}
t   restrictt   __restrict__t
   __restrictR   N(   R   R   R	   (   R
   R   R   R   (    (    s?   /tmp/pip-build-2Vcwy8/numpy/numpy/distutils/command/autodist.pyt   check_restrict   s    
 c         C` s#   |  j  ƒ  d } |  j | d d ƒ S(   s)   Return True if the C compiler is GCC 4.x.si   
int
main()
{
#if (! defined __GNUC__) || (__GNUC__ < 4)
#error gcc >= 4 required
#endif
    return 0;
}
N(   R   R   R	   (   R
   R   (    (    s?   /tmp/pip-build-2Vcwy8/numpy/numpy/distutils/command/autodist.pyt   check_compiler_gcc40   s    

c         C` s3   |  j  ƒ  d | | f } |  j | d d ƒ d k S(   s9   Return True if the given function attribute is supported.sŒ   
#pragma GCC diagnostic error "-Wattributes"
#pragma clang diagnostic error "-Wattributes"

int %s %s(void*);

int
main()
{
    return 0;
}
i    N(   R   R   R	   (   R
   t	   attributet   nameR   (    (    s?   /tmp/pip-build-2Vcwy8/numpy/numpy/distutils/command/autodist.pyt   check_gcc_function_attribute@   s    
c         C` s0   |  j  ƒ  d | f } |  j | d d ƒ d k S(   s9   Return True if the given variable attribute is supported.s†   
#pragma GCC diagnostic error "-Wattributes"
#pragma clang diagnostic error "-Wattributes"

int %s foo;

int
main()
{
    return 0;
}
i    N(   R   R   R	   (   R
   R   R   (    (    s?   /tmp/pip-build-2Vcwy8/numpy/numpy/distutils/command/autodist.pyt   check_gcc_variable_attributeQ   s    
N(
   t   __doc__t
   __future__R    R   R   R   R   R   R   R   (    (    (    s?   /tmp/pip-build-2Vcwy8/numpy/numpy/distutils/command/autodist.pyt   <module>   s   				