Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support new function signature for eio_custom in Node 0.5.4+.

  • Loading branch information...
commit 70ed3b3e89331d69414167571a5affa2f8b4a2fc 1 parent 9b9ba50
@justmoon authored
Showing with 13 additions and 5 deletions.
  1. +13 −5 src/_kyoto.cc
View
18 src/_kyoto.cc
@@ -70,11 +70,19 @@ using namespace kyotocabinet;
return args.This(); \
} \
-#define DEFINE_EXEC(Name, Request) \
- static int EIO_Exec##Name(eio_req *ereq) { \
- Request* req = static_cast<Request *>(ereq->data); \
- return req->exec(); \
- } \
+#if NODE_VERSION_AT_LEAST(0, 5, 4)
+#define DEFINE_EXEC(Name, Request) \
+ static int EIO_Exec##Name(eio_req *ereq) { \
+ Request* req = static_cast<Request *>(ereq->data); \
+ return req->exec(); \
+ }
+#else
+#define DEFINE_EXEC(Name, Request) \
+ static void EIO_Exec##Name(eio_req *ereq) { \
+ Request* req = static_cast<Request *>(ereq->data); \
+ req->exec(); \
+ }
+#endif
#define DEFINE_AFTER(Name, Request) \
static int EIO_After##Name(eio_req *ereq) { \
Please sign in to comment.
Something went wrong with that request. Please try again.