summaryrefslogtreecommitdiff
path: root/include/fortify-headers.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/fortify-headers.h')
-rw-r--r--include/fortify-headers.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h
index c7b15f9..bd53954 100644
--- a/include/fortify-headers.h
+++ b/include/fortify-headers.h
@@ -123,13 +123,17 @@
123 123
124#endif /* __has_attribute */ 124#endif /* __has_attribute */
125 125
126// Since we're not allow to include anything.
127// https://awesomekling.github.io/How-SerenityOS-declares-ssize_t/
128#define __fh_size_t __typeof__(sizeof(char))
129
126//TODO(jvoisin) Add a check for overflows 130//TODO(jvoisin) Add a check for overflows
127/* check if pointers are overlapping but not if dst == src, 131/* check if pointers are overlapping but not if dst == src,
128 * since gcc seems to like to generate code that relies on dst == src */ 132 * since gcc seems to like to generate code that relies on dst == src */
129#define __fh_overlap(a, b, l) \ 133#define __fh_overlap(a, b, l) \
130 ( \ 134 ( \
131 ((a) < (b) && (b) < (a) + (size_t)(l)) \ 135 ((a) < (b) && (b) < (a) + (__fh_size_t)(l)) \
132 || ((b) < (a) && (a) < (b) + (size_t)(l)) \ 136 || ((b) < (a) && (a) < (b) + (__fh_size_t)(l)) \
133 ) 137 )
134 138
135/* 139/*