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
|
$NetBSD: patch-numpy_distutils_command_config.py,v 1.1 2022/05/23 17:28:41 ryoon Exp $
* Workaround for undefined-sysbol errors from graphics/py-matplotlib.
--- numpy/distutils/command/config.py.orig 2022-05-17 10:56:58.000000000 +0000
+++ numpy/distutils/command/config.py
@@ -321,11 +321,7 @@ class config(old_config):
# return a value.
self._check_compiler()
body = []
- if decl:
- if type(decl) == str:
- body.append(decl)
- else:
- body.append("int %s (void);" % func)
+ body.append("int %s (void);" % func)
# Handle MSVC intrinsics: force MS compiler to make a function call.
# Useful to test for some functions when built with optimization on, to
# avoid build error because the intrinsic and our 'fake' test
@@ -336,15 +332,16 @@ class config(old_config):
body.append("int main (void) {")
if call:
if call_args is None:
+ body.append(" %s(%s);" % (func, call_args))
call_args = ''
- body.append(" %s(%s);" % (func, call_args))
+ body.append(" %s();" % func)
else:
body.append(" %s;" % func)
body.append(" return 0;")
body.append("}")
body = '\n'.join(body) + "\n"
- return self.try_link(body, headers, include_dirs,
+ return self.try_link(body, None, include_dirs,
libraries, library_dirs)
def check_funcs_once(self, funcs,
@@ -376,10 +373,8 @@ class config(old_config):
"""
self._check_compiler()
body = []
- if decl:
- for f, v in decl.items():
- if v:
- body.append("int %s (void);" % f)
+ for f in funcs:
+ body.append("int %s (void);" % f)
# Handle MS intrinsics. See check_func for more info.
body.append("#ifdef _MSC_VER")
@@ -395,7 +390,7 @@ class config(old_config):
args = ''
else:
args = call_args[f]
- body.append(" %s(%s);" % (f, args))
+ body.append(" %s();" % f)
else:
body.append(" %s;" % f)
else:
@@ -405,7 +400,7 @@ class config(old_config):
body.append("}")
body = '\n'.join(body) + "\n"
- return self.try_link(body, headers, include_dirs,
+ return self.try_link(body, None, include_dirs,
libraries, library_dirs)
def check_inline(self):
|