aboutsummaryrefslogtreecommitdiff
path: root/src/event.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-10 21:32:45 -0400
committerDeterminant <[email protected]>2019-06-10 21:32:45 -0400
commit299d1a3cf7f7ab2465dccc87dde578044c9b040b (patch)
treeaaf7d58d929fdc564b94dccc6a22576d58bf822f /src/event.cpp
parent66c711cf653b082ae07e1119417dcb3461039c80 (diff)
...
Diffstat (limited to 'src/event.cpp')
-rw-r--r--src/event.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/event.cpp b/src/event.cpp
index 2e38e5f..9b6f432 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -34,15 +34,15 @@ void sigev_free(sigev_t *self) { delete self; }
void sigev_add(sigev_t *self, int sig) { self->add(sig); }
-timerev_t *timerev_new(const eventcontext_t *ec, timerev_callback_t callback) {
- return new timerev_t(*ec, [callback](salticidae::TimerEvent &ev) {
- callback(&ev);
+timerev_t *timerev_new(const eventcontext_t *ec, timerev_callback_t callback, void *userdata) {
+ return new timerev_t(*ec, [=](salticidae::TimerEvent &ev) {
+ callback(&ev, userdata);
});
}
-void timerev_set_callback(timerev_t *self, timerev_callback_t callback) {
- self->set_callback([callback](salticidae::TimerEvent &ev) {
- callback(&ev);
+void timerev_set_callback(timerev_t *self, timerev_callback_t callback, void *userdata) {
+ self->set_callback([=](salticidae::TimerEvent &ev) {
+ callback(&ev, userdata);
});
}