o
    5‘ði’
  ã                   @   sb   d dl Z d dlZd dlZd dlZddlmZ ej d¡Zej	dd„ ƒZ
dd„ Zd	d
„ Zdd„ ZdS )é    Né   )ÚbaseÚsuppress_path_manglec                 C   sd   | d }d}t  ¡ dk}d| }|| }d dd„ |D ƒ¡}t d¡ ¡  d	|¡}|j|d
d� |S )Nzfoo.c)zPython.hÚWindows)z	windows.hÚ
c                 s   s   � | ]	}d |› d�V  qdS )z
#include <z>
N© )Ú.0Úheaderr   r   úp/root/parts/websockify/install/lib/python3.10/site-packages/setuptools/_distutils/compilers/C/tests/test_base.pyÚ	<genexpr>   s   € zc_file.<locals>.<genexpr>z;
        #headers
        void PyInit_foo(void) {}
        z#headerszutf-8)Úencoding)ÚplatformÚsystemÚjoinÚtextwrapÚdedentÚlstripÚreplaceÚ
write_text)Útmp_pathÚc_fileÚgen_headersÚ
is_windowsÚplat_headersÚall_headersÚheadersÚpayloadr   r   r
   r      s   ÿø
r   c                 C   sH   t  ¡ }t ¡ d }| |g¡ | | g¡ | |g¡ | | 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Úcompile©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)ÚincludesÚsetuptools_does_not_existzstdio.h)r   r   Úhas_functionÚpytestÚdeprecated_call)r$   r   r   r
   Útest_has_function_prototype1   s   þþÿ"ÿr/   c                 C   s\   t  ¡ }t ¡ d }| |g¡ | | g¡ |j|gksJ ‚| | g¡ |j|gks,J ‚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"   Úinclude_dirsr#   r   r   r
   Ú.test_include_dirs_after_multiple_compile_callsH   s   r1   )r   r   r   r-   Ú r   ÚmarkÚusefixturesÚ
pytestmarkÚfixturer   r&   r/   r1   r   r   r   r
   Ú<module>   s    
