summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/distutils/mingw32ccompiler.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py
index 5edd0b33a..9aa11f981 100644
--- a/numpy/distutils/mingw32ccompiler.py
+++ b/numpy/distutils/mingw32ccompiler.py
@@ -12,6 +12,7 @@ import os
import sys
import log
import subprocess
+import re
# Overwrite certain distutils.ccompiler functions:
import numpy.distutils.ccompiler
@@ -31,6 +32,10 @@ from distutils.unixccompiler import UnixCCompiler
from distutils.msvccompiler import get_build_version as get_build_msvc_version
from numpy.distutils.misc_util import msvc_runtime_library
+# Useful to generate table of symbols from a dll
+_START = re.compile(r'\[Ordinal/Name Pointer\] Table')
+_TABLE = re.compile(r'^\s+\[([\s*[0-9]*)\] ([a-zA-Z0-9_]*)')
+
# the same as cygwin plus some additional parameters
class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler):
""" A modified MingW32 compiler compatible with an MSVC built Python.
@@ -224,7 +229,7 @@ def generate_def(dll, dfile):
The .def file will be overwritten"""
dump = dump_table(dll)
for i in range(len(dump)):
- if TABLE.match(dump[i]):
+ if _START.match(dump[i]):
break
if i == len(dump):
@@ -232,7 +237,7 @@ def generate_def(dll, dfile):
syms = []
for j in range(i, len(dump)):
- m = table.match(lines[j])
+ m = _TABLE.match(lines[j])
if m:
syms.append((int(m.group(1).strip()), m.group(2)))
else: