Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150275637
D45858.id140513.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D45858.id140513.diff
View Options
diff --git a/lib/libcasper/services/cap_net/cap_net.h b/lib/libcasper/services/cap_net/cap_net.h
--- a/lib/libcasper/services/cap_net/cap_net.h
+++ b/lib/libcasper/services/cap_net/cap_net.h
@@ -93,18 +93,14 @@
socklen_t len, int af);
#else
/* Capability functions. */
-#define cap_bind(chan, s, addr, addrlen) \
- bind(s, addr, addrlen)
-#define cap_connect(chan, s, name, namelen) \
- connect(s, name, namelen)
-#define cap_getaddrinfo(chan, hostname, servname, hints, res) \
- getaddrinfo(hostname, servname, hints, res)
-#define cap_getnameinfo(chan, sa, salen, host, hostlen, serv, servlen, flags) \
- getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
+#define cap_bind(chan, ...) bind(__VA_ARGS__)
+#define cap_connect(chan, ...) connect(__VA_ARGS__)
+#define cap_getaddrinfo(chan, ...) getaddrinfo(__VA_ARGS__)
+#define cap_getnameinfo(chan, ...) getnameinfo(__VA_ARGS__)
/* Limit functions. */
-#define cap_net_limit_init(chan, mode) ((cap_net_limit_t *)malloc(8))
-#define cap_net_free(limit) free(limit)
+#define cap_net_limit_init(chan, ...) ((cap_net_limit_t *)malloc(8))
+#define cap_net_free(...) free(__VA_ARGS__)
static inline int
cap_net_limit(cap_net_limit_t *limit)
{
@@ -155,9 +151,9 @@
}
/* Deprecated functions. */
-#define cap_gethostbyname(chan, name) gethostbyname(name)
-#define cap_gethostbyname2(chan, name, type) gethostbyname2(name, type)
-#define cap_gethostbyaddr(chan, addr, len, type) gethostbyaddr(addr, len, type)
+#define cap_gethostbyname(chan, ...) gethostbyname(__VA_ARGS__)
+#define cap_gethostbyname2(chan, ...) gethostbyname2(__VA_ARGS__)
+#define cap_gethostbyaddr(chan, ...) gethostbyaddr(__VA_ARGS__)
#endif
#endif /* !_CAP_NETWORK_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 31, 7:25 PM (8 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30645682
Default Alt Text
D45858.id140513.diff (1 KB)
Attached To
Mode
D45858: libcasper: Use __VA_ARGS__ for function-like macros
Attached
Detach File
Event Timeline
Log In to Comment