o 6˜¿a†ã@sJdZddlZdd„Zdd„Zdd„Zdd d „Zd d „Zd d„Zdd„ZdS)zKThis module implements additional tests ala autoconf which can be useful. éNcCóB| ¡t d¡}dD]}| |d|idd¡}|r|Sq dS)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__Ú__inlinerNÚ©Ú_check_compilerÚtextwrapÚdedentÚ try_compile©ÚcmdÚbodyÚkwÚst©rúB/usr/lib/python3/dist-packages/numpy/distutils/command/autodist.pyÚ check_inlines  ÿrcCr)z.Return the restrict identifier (may be empty).zj static int static_func (char * %(restrict)s a) { return 0; } )ÚrestrictÚ __restrict__Ú __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 rrrrÚ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Ústrr r r )r rrrrrrrrrÚcheck_gcc_version_at_leastBs  ÿr cCs,| ¡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ÚnamerrrrÚcheck_gcc_function_attributeZs òr#cCs0| ¡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 r!r"ÚcodeÚincluderrrrÚ,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 r!rrrrÚcheck_gcc_variable_attribute…s  õ r')rr) Ú__doc__r rrrr r#r&r'rrrrÚs