Skip to content

Commit ae87843

Browse files
committed
clang format
1 parent dac6058 commit ae87843

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

include/iso_alloc_hook.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@
2424
#pragma GCC diagnostic ignored "-Wattribute-alias"
2525
#endif
2626
#define ISO_FORWARD(fun) __attribute__((alias(#fun), used, visibility("default"), copy(fun)));
27-
#define ISO_FORWARD0(fun, x) ISO_FORWARD(fun)
28-
#define ISO_FORWARD1(fun, x) ISO_FORWARD(fun)
29-
#define ISO_FORWARD2(fun, x, y) ISO_FORWARD(fun)
27+
#define ISO_FORWARD0(fun, x) ISO_FORWARD(fun)
28+
#define ISO_FORWARD1(fun, x) ISO_FORWARD(fun)
29+
#define ISO_FORWARD2(fun, x, y) ISO_FORWARD(fun)
3030
#define ISO_FORWARD3(fun, x, y, z) ISO_FORWARD(fun)
3131
#else
32-
#define ISO_FORWARD0(fun, x) { fun(x); }
33-
#define ISO_FORWARD1(fun, x) { return fun(x); }
34-
#define ISO_FORWARD2(fun, x, y) { return fun(x, y); }
35-
#define ISO_FORWARD3(fun, x, y, z) { return fun(x, y, z); }
32+
#define ISO_FORWARD0(fun, x) \
33+
{ fun(x); }
34+
#define ISO_FORWARD1(fun, x) \
35+
{ return fun(x); }
36+
#define ISO_FORWARD2(fun, x, y) \
37+
{ return fun(x, y); }
38+
#define ISO_FORWARD3(fun, x, y, z) \
39+
{ return fun(x, y, z); }
3640
#endif

src/malloc_hook.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* alias targets (iso_alloc, iso_free, etc.) are defined in the same
66
* translation unit. When compiled directly the guard
77
* below produces an empty translation unit with no effect. */
8+
// clang-format off
89
#if !defined(ISO_IN_INTERFACES_C)
910
#error "malloc_hook.c must be included from iso_alloc_interfaces.c (so aliases can work)"
1011
#endif
@@ -121,3 +122,4 @@ void (*__free_hook)(void *, const void *) = &libc_free;
121122
void *(*__memalign_hook)(size_t, size_t, const void *) = &libc_memalign;
122123
#endif
123124
#endif
125+
// clang-format on

0 commit comments

Comments
 (0)