Skip to content

Commit 728cff8

Browse files
Fix C4296 in bindingccpp
1 parent 97e2c4c commit 728cff8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/buildbindingccpp.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,11 @@ func buildCppHeader(component ComponentDefinition, w LanguageWriter, NameSpace s
13551355
w.Writeln(" {")
13561356
w.Writeln(" %s_uint32 nMajor, nMinor, nMicro;", NameSpace)
13571357
w.Writeln(" %s(nMajor, nMinor, nMicro);", global.VersionMethod)
1358-
w.Writeln(" if ( (nMajor != %s_VERSION_MAJOR) || (nMinor < %s_VERSION_MINOR) ) {", strings.ToUpper(NameSpace), strings.ToUpper(NameSpace))
1358+
if minorVersion(component.Version) > 0 {
1359+
w.Writeln(" if ( (nMajor != %s_VERSION_MAJOR) || (nMinor < %s_VERSION_MINOR) ) {", strings.ToUpper(NameSpace), strings.ToUpper(NameSpace))
1360+
} else {
1361+
w.Writeln(" if (nMajor != %s_VERSION_MAJOR) {", strings.ToUpper(NameSpace))
1362+
}
13591363
w.Writeln(" return %s_ERROR_INCOMPATIBLEBINARYVERSION;", strings.ToUpper(NameSpace))
13601364
w.Writeln(" }")
13611365
w.Writeln(" return %s_SUCCESS;", strings.ToUpper(NameSpace))

0 commit comments

Comments
 (0)