Skip to content

Commit e4cff82

Browse files
committed
add version idef guards
1 parent c70aea7 commit e4cff82

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cc/io/io.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ NAN_MODULE_INIT(Io::Init) {
1616
Nan::SetMethod(target, "imshowWait", ImshowWait);
1717
Nan::SetMethod(target, "imwrite", Imwrite);
1818
Nan::SetMethod(target, "waitKey", WaitKey);
19+
#if CV_VERSION_GREATER_EQUAL(3, 2, 0)
1920
Nan::SetMethod(target, "waitKeyEx", WaitKeyEx);
21+
#endif
2022
Nan::SetMethod(target, "imencode", Imencode);
2123
Nan::SetMethod(target, "imdecode", Imdecode);
2224
Nan::SetMethod(target, "moveWindow", MoveWindow);
@@ -106,6 +108,7 @@ NAN_METHOD(Io::WaitKey) {
106108
info.GetReturnValue().Set(Nan::New(key));
107109
}
108110

111+
#if CV_VERSION_GREATER_EQUAL(3, 2, 0)
109112
NAN_METHOD(Io::WaitKeyEx) {
110113
int key;
111114
if (info[0]->IsNumber()) {
@@ -115,6 +118,7 @@ NAN_METHOD(Io::WaitKeyEx) {
115118
}
116119
info.GetReturnValue().Set(Nan::New(key));
117120
}
121+
#endif
118122

119123
NAN_METHOD(Io::MoveWindow) {
120124
FF::TryCatch tryCatch("Io::MoveWindow");

cc/io/io.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ class Io {
1616
static NAN_METHOD(Imshow);
1717
static NAN_METHOD(ImshowWait);
1818
static NAN_METHOD(WaitKey);
19+
#if CV_VERSION_GREATER_EQUAL(3, 2, 0)
1920
static NAN_METHOD(WaitKeyEx);
21+
#endif
2022
static NAN_METHOD(MoveWindow);
2123
static NAN_METHOD(DestroyWindow);
2224
static NAN_METHOD(DestroyAllWindows);

0 commit comments

Comments
 (0)