Indent
This commit is contained in:
parent
e561dc6bb1
commit
833cf5d2c8
15
common.h
15
common.h
@ -34,13 +34,16 @@
|
|||||||
#define _STRMERGE(a, b) a##b
|
#define _STRMERGE(a, b) a##b
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
static void __attribute__((unused)) _clang_cleanup_func(void (^*dfunc)(void)) { (*dfunc)(); }
|
static void __attribute__ ((unused)) _clang_cleanup_func(void (^*dfunc) (void))
|
||||||
#define defer(a) void (^_STRMERGE(__df_, __COUNTER__))(void) __attribute__((cleanup(_clang_cleanup_func))) __attribute__((unused)) = ^{ a; }
|
{
|
||||||
#else
|
(*dfunc) ();
|
||||||
#define __block
|
}
|
||||||
#define defer(a) void _STRMERGE(_cleanup_func_, __LINE__)(void *_STRMERGE(_cleanup_unused_, __LINE__) __attribute__((unused))) { a; } ; int _STRMERGE(_cleanup_var_, __LINE__) __attribute__((cleanup(_STRMERGE(_cleanup_func_, __LINE__)))) __attribute__((unused))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#define defer(a) void (^_STRMERGE(__df_, __COUNTER__))(void) __attribute__((cleanup(_clang_cleanup_func))) __attribute__((unused)) = ^{ a; }
|
||||||
|
#else
|
||||||
|
#define __block
|
||||||
|
#define defer(a) void _STRMERGE(_cleanup_func_, __LINE__)(void *_STRMERGE(_cleanup_unused_, __LINE__) __attribute__((unused))) { a; } ; int _STRMERGE(_cleanup_var_, __LINE__) __attribute__((cleanup(_STRMERGE(_cleanup_func_, __LINE__)))) __attribute__((unused))
|
||||||
|
#endif
|
||||||
|
|
||||||
struct pids_t {
|
struct pids_t {
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
2
net.c
2
net.c
@ -327,7 +327,7 @@ static bool netIfaceUp(const char *ifacename)
|
|||||||
PLOG_E("socket(AF_INET, SOCK_STREAM, IPPROTO_IP)");
|
PLOG_E("socket(AF_INET, SOCK_STREAM, IPPROTO_IP)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
defer(close(sock));
|
defer(close(sock));
|
||||||
|
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
memset(&ifr, '\0', sizeof(ifr));
|
memset(&ifr, '\0', sizeof(ifr));
|
||||||
|
Loading…
Reference in New Issue
Block a user