build: resolve a -Wunused-function compiler warning (#308)

posixSocket.cpp:67:7: warning: ‘char*
{anonymous}::vmime_strerror_r_result(int, char*)’ defined but not
used [-Wunused-function]
   67 | char* vmime_strerror_r_result(int /* res */, char* buf) {

It is to be expected that one of the two r_result functions is going unused,
depending on whichever platform we are currently building on.
This commit is contained in:
Jan Engelhardt 2024-06-11 20:44:18 +02:00 committed by GitHub
parent a2636bd4ae
commit 5f8fa22602
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,14 +64,20 @@
namespace {
char* vmime_strerror_r_result(int /* res */, char* buf) {
#ifdef __GNUC__
# define GNU_UNUSED [[gnu::unused]]
#else
# define GNU_UNUSED
#endif
GNU_UNUSED char* vmime_strerror_r_result(int /* res */, char* buf) {
// XSI-compliant prototype:
// int strerror_r(int errnum, char *buf, size_t buflen);
return buf;
}
char* vmime_strerror_r_result(char* res, char* /* buf */) {
GNU_UNUSED char* vmime_strerror_r_result(char* res, char* /* buf */) {
// GNU-specific prototype:
// char *strerror_r(int errnum, char *buf, size_t buflen);