forked from JCMais/node-libcurl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacros.h
More file actions
38 lines (24 loc) · 827 Bytes
/
macros.h
File metadata and controls
38 lines (24 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef NODELIBCURL_MACROS_H
#define NODELIBCURL_MACROS_H
#if UV_VERSION_MAJOR < 1 && UV_VERSION_MINOR < 11
#define UV_TIMER_CB(cb) \
void cb( uv_timer_t *timer, int status )
#define UV_CALL_TIMER_CB(cb, timer, status) \
cb( timer, status )
#else
#define UV_TIMER_CB(cb) \
void cb( uv_timer_t *timer )
#define UV_CALL_TIMER_CB(cb, timer, status) \
cb( timer )
#endif
#if UV_VERSION_MAJOR < 1
#define UV_ERROR_STRING(err) \
uv_strerror( uv_last_error( uv_default_loop() ) )
#else
#define UV_ERROR_STRING(err) \
uv_strerror( err )
#endif
// inspired from the LUA bindings.
#define NODE_LIBCURL_MAKE_VERSION(MAJ, MIN, PAT) ((MAJ<<16) + (MIN<<8) + PAT)
#define NODE_LIBCURL_VER_GE(MAJ, MIN, PAT) (LIBCURL_VERSION_NUM >= NODE_LIBCURL_MAKE_VERSION(MAJ, MIN, PAT))
#endif