Skip to content

Commit b263dce

Browse files
committed
Merge branch 'develop', remote-tracking branch 'origin' into fix/issues-22_severe_memory_leak
3 parents 21adfe1 + f017d0c + 504baa6 commit b263dce

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ext/opencv/extconf.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ def cv_version_suffix(incdir)
55
major, minor, subminor = nil, nil, nil
66
open("#{incdir}/opencv2/core/version.hpp", 'r') { |f|
77
f.read.lines.each { |line|
8-
major = $1.to_s if line =~ /\A#define\s+CV_MAJOR_VERSION\s+(\d+)\s*\Z/
9-
minor = $1.to_s if line =~ /\A#define\s+CV_MINOR_VERSION\s+(\d+)\s*\Z/
10-
subminor = $1.to_s if line =~ /\A#define\s+CV_SUBMINOR_VERSION\s+(\d+)\s*\Z/
8+
major = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_EPOCH|CV_MAJOR_VERSION)\s+(\d+)\s*\Z/
9+
minor = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_MAJOR|CV_MINOR_VERSION)\s+(\d+)\s*\Z/
10+
subminor = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_MINOR|CV_SUBMINOR_VERSION)\s+(\d+)\s*\Z/
1111
}
1212
}
1313
major + minor + subminor
@@ -70,8 +70,10 @@ def cv_version_suffix(incdir)
7070
}
7171
have_header("stdarg.h")
7272

73-
$warnflags.slice!('-Wdeclaration-after-statement')
74-
$warnflags.slice!('-Wimplicit-function-declaration')
73+
if $warnflags
74+
$warnflags.slice!('-Wdeclaration-after-statement')
75+
$warnflags.slice!('-Wimplicit-function-declaration')
76+
end
7577

7678
# Quick fix for 1.8.7
7779
$CFLAGS << " -I#{File.dirname(__FILE__)}/ext/opencv"

0 commit comments

Comments
 (0)