zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
U
O±dã@sJdZddlZdd„Zdd„Zdd„Zdd    d
„Zd d „Zd d„Zdd„ZdS)zKThis module implements additional tests ala autoconf which can be useful.
 
éNcCsB| ¡t d¡}dD]&}| |d|idd¡}|r|SqdS)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__inlinerNÚ©Ú_check_compilerÚtextwrapÚdedentÚ try_compile©ÚcmdÚbodyÚkwÚst©rúWd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/distutils/command/autodist.pyÚ check_inlines
 
rcCsB| ¡t d¡}dD]&}| |d|idd¡}|r|SqdS)z.Return the restrict identifier (may be empty).zj
        static int static_func (char * %(restrict)s a)
        {
            return 0;
        }
        )ÚrestrictZ __restrict__Z
__restrictrNrrr    rrrÚcheck_restricts
 
rcCs | ¡t d¡}| |dd¡S)zCheck if the compiler is GCC.zš
        int
        main()
        {
        #if (! defined __GNUC__)
        #error gcc required
        #endif
            return 0;
        }
        Nr)r
r rrrÚcheck_compiler_gcc1s
 
rcCsN| ¡d t|ƒt|ƒt|ƒg¡}t d¡}||||dœ}| ||dd¡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Ústrrrr)r
rrrrr r rrrÚcheck_gcc_version_at_leastBs
ÿrcCs,| ¡t d¡||f}| |dd¡dkS)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;
        }
        Nrr)r
Ú    attributeÚnamer rrrÚcheck_gcc_function_attributeZs
òrcCs0| ¡t d¡||||f}| |dd¡dkS)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;
        }
        Nrr)r
rrÚcodeÚincluder rrrÚ,check_gcc_function_attribute_with_intrinsicsos
 
ór!cCs*| ¡t d¡|f}| |dd¡dkS)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;
        }
        Nrr)r
rr rrrÚcheck_gcc_variable_attribute…s
 õ r")rr)    Ú__doc__rrrrrrr!r"rrrrÚ<module>s