summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/f2py/capi_maps.py2
-rwxr-xr-xnumpy/f2py/rules.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/numpy/f2py/capi_maps.py b/numpy/f2py/capi_maps.py
index e5dc2331a..f07066a09 100644
--- a/numpy/f2py/capi_maps.py
+++ b/numpy/f2py/capi_maps.py
@@ -176,6 +176,7 @@ f2cmap_all = {'real': {'': 'float', '4': 'float', '8': 'double',
f2cmap_default = copy.deepcopy(f2cmap_all)
+f2cmap_mapped = []
def load_f2cmap_file(f2cmap_file):
global f2cmap_all
@@ -212,6 +213,7 @@ def load_f2cmap_file(f2cmap_file):
f2cmap_all[k][k1] = d[k][k1]
outmess('\tMapping "%s(kind=%s)" to "%s"\n' %
(k, k1, d[k][k1]))
+ f2cmap_mapped.append(d[k][k1])
else:
errmess("\tIgnoring map {'%s':{'%s':'%s'}}: '%s' must be in %s\n" % (
k, k1, d[k][k1], d[k][k1], list(c2py_map.keys())))
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py
index c9c3b2383..63c48a878 100755
--- a/numpy/f2py/rules.py
+++ b/numpy/f2py/rules.py
@@ -1323,6 +1323,9 @@ def buildmodule(m, um):
rd = dictappend(rd, ar)
needs = cfuncs.get_needs()
+ # Add mapped definitions
+ needs['typedefs'] += [cvar for cvar in capi_maps.f2cmap_mapped #
+ if cvar in typedef_need_dict.values()]
code = {}
for n in needs.keys():
code[n] = []