B
    ôàn\   ã               @   sD   d Z ddlmZmZmZ dd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Z	dS )zKThis module implements additional tests ala autoconf which can be useful.

é    )ÚdivisionÚabsolute_importÚprint_functionc             C   s<   |   ¡  d}x*dD ]"}|  |d|i dd¡}|r|S qW dS )z,Return the inline identifier (may be empty).zŒ
#ifndef __cplusplus
static %(inline)s int static_func (void)
{
    return 0;
}
%(inline)s int nostatic_func (void)
{
    return 0;
}
#endif)ÚinlineZ
__inline__Z__inliner   NÚ )Ú_check_compilerÚtry_compile)ÚcmdÚbodyÚkwÚst© r   ú?lib/python3.7/site-packages/numpy/distutils/command/autodist.pyÚcheck_inline	   s    
r   c             C   s<   |   ¡  d}x*dD ]"}|  |d|i dd¡}|r|S qW dS )z.Return the restrict identifier (may be empty).zB
static int static_func (char * %(restrict)s a)
{
    return 0;
}
)ÚrestrictZ__restrict__Z
__restrictr   Nr   )r   r   )r	   r
   r   r   r   r   r   Úcheck_restrict   s    
r   c             C   s   |   ¡  d}|  |dd¡S )z)Return True if the C compiler is GCC 4.x.zi
int
main()
{
#if (! defined __GNUC__) || (__GNUC__ < 4)
#error gcc >= 4 required
#endif
    return 0;
}
N)r   r   )r	   r
   r   r   r   Úcheck_compiler_gcc40   s    
r   c             C   s&   |   ¡  d||f }|  |dd¡dkS )z9Return True if the given function attribute is supported.zŒ
#pragma GCC diagnostic error "-Wattributes"
#pragma clang diagnostic error "-Wattributes"

int %s %s(void*);

int
main()
{
    return 0;
}
Nr   )r   r   )r	   Ú	attributeÚnamer
   r   r   r   Úcheck_gcc_function_attribute@   s    r   c             C   s$   |   ¡  d|f }|  |dd¡dkS )z9Return True if the given variable attribute is supported.z†
#pragma GCC diagnostic error "-Wattributes"
#pragma clang diagnostic error "-Wattributes"

int %s foo;

int
main()
{
    return 0;
}
Nr   )r   r   )r	   r   r
   r   r   r   Úcheck_gcc_variable_attributeQ   s    
r   N)
Ú__doc__Z
__future__r   r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s   