
    G/Ph                     >    d Z ddlZd Zd Zd Zd
dZd Zd Zd	 ZdS )zKThis module implements additional tests ala autoconf which can be useful.

    Nc                     |                                   t          j        d          }dD ]$}|                     |d|iz  dd          }|r|c S %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)inline
__inline____inliner   N _check_compilertextwrapdedenttry_compilecmdbodykwsts       `/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numpy/distutils/command/autodist.pycheck_inliner      sv    ? 
 
 
D 3  __TXrN2D$?? 	III	 2    c                     |                                   t          j        d          }dD ]$}|                     |d|iz  dd          }|r|c S %dS )z.Return the restrict identifier (may be empty).zj
        static int static_func (char * %(restrict)s a)
        {
            return 0;
        }
        )restrict__restrict__
__restrictr   Nr   r   r   s       r   check_restrictr      sw    ?   D 9  __TZ$44dDAA 	III	 2r   c                     |                                   t          j        d          }|                     |dd          S )zCheck if the compiler is GCC.z
        int
        main()
        {
        #if (! defined __GNUC__)
        #error gcc required
        #endif
            return 0;
        }
        Nr   )r   r   s     r   check_compiler_gccr   1   sD     ? 	 	 	D ??4t,,,r   c                    |                                   d                    t          |          t          |          t          |          g          }t          j        d          }||||d}|                     ||z  dd          S )zB
    Check that the gcc version is at least the specified version..a1  
        int
        main()
        {
        #if (! defined __GNUC__) || (__GNUC__ < %(major)d) || \
                (__GNUC_MINOR__ < %(minor)d) || \
                (__GNUC_PATCHLEVEL__ < %(patchlevel)d)
        #error gcc >= %(version)s required
        #endif
            return 0;
        }
        )versionmajorminor
patchlevelN)r	   joinstrr
   r   r   )r   r   r    r!   r   r   r   s          r   check_gcc_version_at_leastr$   B   s     hhE

CJJJ@AAG?   D uu"
$ 
$B ??4"9dD111r   c                     |                                   t          j        d          ||fz  }|                     |dd          dk    S )z9Return True if the given function attribute is supported.a  
        #pragma GCC diagnostic error "-Wattributes"
        #pragma clang diagnostic error "-Wattributes"

        int %s %s(void* unused)
        {
            return 0;
        }

        int
        main()
        {
            return 0;
        }
        Nr   r   )r   	attributenamer   s       r   check_gcc_function_attributer(   Z   sV    ?    4 !D ??4t,,11r   c                     |                                   t          j        d          ||||fz  }|                     |dd          dk    S )zMReturn True if the given function attribute is supported with
    intrinsics.z
        #include<%s>
        int %s %s(void)
        {
            %s;
            return 0;
        }

        int
        main()
        {
            return 0;
        }
        Nr   r   )r   r&   r'   codeincluder   s         r   ,check_gcc_function_attribute_with_intrinsicsr,   o   s\     ?    D$/0D ??4t,,11r   c                     |                                   t          j        d          |fz  }|                     |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   s      r   check_gcc_variable_attributer.      sS    ?    }D ??4t,,11r   )r   r   )	__doc__r
   r   r   r   r$   r(   r,   r.    r   r   <module>r1      s       .  $- - -"2 2 2 202 2 2*2 2 2,2 2 2 2 2r   