
    ?wg                         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                  j                  d      Z
d Zej                  d        Zd Zd Zd Zy)	    N)	ccompilersuppress_path_manglec                     t         j                  dkD  rt        j                         dk7  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)pathss    a/var/www/horilla/myenv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_ccompiler.py
_make_strsr      s;     & X__%6)%CBIIu%&&    c                    | dz  }d}t        j                         dk(  }d|z  }||z   }dj                  d |D              }t        j                  d      j                         j                  d|      }|j                  |d	
       |S )Nzfoo.c)zPython.hr   )z	windows.h
c              3   (   K   | ]
  }d | d  yw)z
#include <z>
N ).0headers     r   	<genexpr>zc_file.<locals>.<genexpr>   s     KV*VHC0Ks   z;
        #headers
        void PyInit_foo(void) {}
        z#headerszutf-8)encoding)r   r   jointextwrapdedentlstripreplace
write_text)tmp_pathc_filegen_headers
is_windowsplat_headersall_headersheaderspayloads           r   r$   r$      s    FK"i/J!J.L,KiiK{KKG	
 
	W	%  g0Mr   c                    t        j                         }t        j                         d   }|j	                  |g       |j                  t        | g             |j	                  |g       |j                  t        | g             y)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pythons      r   test_set_include_dirsr5   ,   sq    
 %%'H  "9-Fvh'Z)* vh'Z)*r   c                  *   t        j                         } | j                  d      sJ | j                  d      sJ t        j                  d      5  | j                  ddg      sJ 	 d d d        t        j                  d      5  | j                  ddg      rJ 	 d d d        | j                  d      rJ t        j                  d      5  | j                  ddg      rJ 	 d d d        y # 1 sw Y   xY w# 1 sw Y   _xY w# 1 sw Y   y xY w)	Nabortexitzincludes is deprecated)matchzstdlib.h)includessetuptools_does_not_existzstdio.h)r   r-   has_functionpytestdeprecated_call)r3   s    r   test_has_function_prototyper?   ;   s0    %%'H   )))  (((			&>	? E$$W
|$DDDE 
		&>	? H((:,(GGGGH $$%@AAA			&>	? 
(('9+ ) 
 	
 
 

 
E EH H

 
s$   C1C=D	1C:=D	Dc                 2   t        j                         }t        j                         d   }|j	                  |g       |j                  t        | g             |j                  |gk(  sJ |j                  t        | g             |j                  |gk(  sJ y)z}
    Calling compile multiple times should not change the include dirs
    (regression test for setuptools issue #3591).
    r,   N)r   r-   r.   r/   r0   r1   r   include_dirsr2   s      r   .test_include_dirs_after_multiple_compile_callsrB   R   s    
 %%'H  "9-Fvh'Z)*  VH,,,Z)*  VH,,,r   )r   r   r	   r.   r   	distutilsr   r=   markusefixtures
pytestmarkr   fixturer$   r5   r?   rB   r   r   r   <module>rH      s[    	  
    [[$$%;<
'  *+
.-r   