fortify: inline #defined strings
These were originally #defined so we could share them between our
GCC and clang FORTIFY implementations. Since we no longer have a GCC
FORTIFY, #defining them is sort of pointless.
Bug: 131861088
Test: mma
Change-Id: I2ae4e0bdebbed16c946f5df7cc38c471881b481e
diff --git a/libc/include/bits/fortify/socket.h b/libc/include/bits/fortify/socket.h
index c1a85c6..c9387c0 100644
--- a/libc/include/bits/fortify/socket.h
+++ b/libc/include/bits/fortify/socket.h
@@ -37,14 +37,12 @@
#if defined(__BIONIC_FORTIFY)
-#define __recvfrom_bad_size "'recvfrom' called with size bigger than buffer"
-#define __sendto_bad_size "'sendto' called with size bigger than buffer"
-
#if __ANDROID_API__ >= __ANDROID_API_N__
__BIONIC_FORTIFY_INLINE
ssize_t recvfrom(int fd, void* const buf __pass_object_size0, size_t len, int flags, struct sockaddr* src_addr, socklen_t* addr_len)
__overloadable
- __clang_error_if(__bos_unevaluated_lt(__bos0(buf), len), __recvfrom_bad_size) {
+ __clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
+ "'recvfrom' called with size bigger than buffer") {
size_t bos = __bos0(buf);
if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) {
@@ -58,7 +56,8 @@
__BIONIC_FORTIFY_INLINE
ssize_t sendto(int fd, const void* const buf __pass_object_size0, size_t len, int flags, const struct sockaddr* dest_addr, socklen_t addr_len)
__overloadable
- __clang_error_if(__bos_unevaluated_lt(__bos0(buf), len), __sendto_bad_size) {
+ __clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
+ "'sendto' called with size bigger than buffer") {
size_t bos = __bos0(buf);
if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) {
@@ -84,6 +83,4 @@
return sendto(socket, buf, len, flags, NULL, 0);
}
-#undef __recvfrom_bad_size
-#undef __sendto_bad_size
#endif /* __BIONIC_FORTIFY */