Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
917dcad3
Commit
917dcad3
authored
Jul 06, 2017
by
Davis King
Browse files
Made ctrl+c detection in a mex file work more reliably in newer versions of
matlab.
parent
26524fe7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
dlib/matlab/mex_wrapper.cpp
dlib/matlab/mex_wrapper.cpp
+4
-4
No files found.
dlib/matlab/mex_wrapper.cpp
View file @
917dcad3
...
@@ -3050,12 +3050,12 @@ namespace mex_binding
...
@@ -3050,12 +3050,12 @@ namespace mex_binding
int
num
=
static_cast
<
int
>
(
pptr
()
-
pbase
());
int
num
=
static_cast
<
int
>
(
pptr
()
-
pbase
());
if
(
num
!=
0
)
if
(
num
!=
0
)
{
{
check_for_matlab_ctrl_c
();
buf
[
num
]
=
0
;
// null terminate the string
buf
[
num
]
=
0
;
// null terminate the string
mexPrintf
(
"%s"
,
&
buf
[
0
]);
mexPrintf
(
"%s"
,
&
buf
[
0
]);
mexEvalString
(
"drawnow"
);
// flush print to screen
mexEvalString
(
"drawnow"
);
// flush print to screen
pbump
(
-
num
);
pbump
(
-
num
);
check_for_matlab_ctrl_c
();
}
}
return
0
;
return
0
;
}
}
...
@@ -3108,12 +3108,12 @@ namespace mex_binding
...
@@ -3108,12 +3108,12 @@ namespace mex_binding
int
num
=
static_cast
<
int
>
(
pptr
()
-
pbase
());
int
num
=
static_cast
<
int
>
(
pptr
()
-
pbase
());
if
(
num
!=
0
)
if
(
num
!=
0
)
{
{
check_for_matlab_ctrl_c
();
buf
[
num
]
=
0
;
// null terminate the string
buf
[
num
]
=
0
;
// null terminate the string
mexWarnMsgTxt
(
&
buf
[
0
]);
mexWarnMsgTxt
(
&
buf
[
0
]);
mexEvalString
(
"drawnow"
);
// flush print to screen
mexEvalString
(
"drawnow"
);
// flush print to screen
pbump
(
-
num
);
pbump
(
-
num
);
check_for_matlab_ctrl_c
();
}
}
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment