o
    ªZhÒ  ã                   @   sz   d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlZej 	d¡Z
dd„ Zejdd„ ƒZdd	„ Zd
d„ Zdd„ ZdS )é    N)Ú	ccompilerZsuppress_path_manglec                 C   s*   t jdkrt ¡ dkr| S tttj| ƒƒS )z<
    Convert paths to strings for legacy compatibility.
    )é   é   ÚWindows)ÚsysÚversion_infoÚplatformÚsystemÚlistÚmapÚosÚfspath)Úpaths© r   úa/var/www/html/lang_env/lib/python3.10/site-packages/setuptools/_distutils/tests/test_ccompiler.pyÚ
_make_strs   s   r   c                 C   sd   | d }d}t  ¡ dk}d| }|| }d dd„ |D ƒ¡}t d¡ ¡  d	|¡}|j|d
d |S )Nzfoo.c)zPython.hr   )z	windows.hÚ
c                 s   s    | ]	}d |› dV  qdS )z
#include <z>
Nr   )Ú.0Úheaderr   r   r   Ú	<genexpr>   s   € zc_file.<locals>.<genexpr>z;
        #headers
        void PyInit_foo(void) {}
        z#headerszutf-8)Úencoding)r   r	   ÚjoinÚtextwrapÚdedentÚlstripÚreplaceÚ
write_text)Ztmp_pathÚc_fileZgen_headersZ
is_windowsZplat_headersZall_headersÚheadersÚpayloadr   r   r   r      s   ÿø
r   c                 C   sP   t  ¡ }t ¡ d }| |g¡ | t| gƒ¡ | |g¡ | t| gƒ¡ dS )z‹
    Extensions should build even if set_include_dirs is invoked.
    In particular, compiler-specific paths should not be overridden.
    ÚincludeN)r   Únew_compilerÚ	sysconfigÚ	get_pathsÚset_include_dirsÚcompiler   ©r   ÚcompilerÚpythonr   r   r   Útest_set_include_dirs,   s   r)   c                  C   sø   t  ¡ } |  d¡sJ ‚|  d¡sJ ‚tjdd | jddgds#J ‚W d   ƒ n1 s-w   Y  tjdd | jddgdrCJ ‚W d   ƒ n1 sMw   Y  |  d¡rYJ ‚tjdd | jddgdrjJ ‚W d   ƒ d S 1 suw   Y  d S )	NÚabortÚexitzincludes is deprecated)Úmatchzstdlib.h)ZincludesZsetuptools_does_not_existzstdio.h)r   r!   Zhas_functionÚpytestZdeprecated_call)r'   r   r   r   Útest_has_function_prototype;   s   þþÿ"ÿr.   c                 C   sd   t  ¡ }t ¡ d }| |g¡ | t| gƒ¡ |j|gks J ‚| t| gƒ¡ |j|gks0J ‚dS )z}
    Calling compile multiple times should not change the include dirs
    (regression test for setuptools issue #3591).
    r    N)r   r!   r"   r#   r$   r%   r   Zinclude_dirsr&   r   r   r   Ú.test_include_dirs_after_multiple_compile_callsR   s   r/   )r   r   r   r"   r   Ú	distutilsr   r-   ÚmarkZusefixturesZ
pytestmarkr   Zfixturer   r)   r.   r/   r   r   r   r   Ú<module>   s    	
