From c01a1426653f7424e883794a94caa086f23372ed Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Mon, 25 Jun 2012 05:29:39 +0000 Subject: [PATCH] Implement su_errno and su_seterrno as functions This avoid warnings about expressions with unused values. These warnings break the build with clang. An optimizing compiler should still inline these calls. If that turns out not to happen on some platform, we could rename the functions used internally and declare them static inline. --- libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h | 5 ----- libs/sofia-sip/libsofia-sip-ua/su/su_errno.c | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h b/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h index c11570c4eb..223f7cf018 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h +++ b/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h @@ -53,11 +53,6 @@ SOFIAPUBFUN int su_errno(void); /** Set the su error. */ SOFIAPUBFUN int su_seterrno(int); -#if !SU_HAVE_WINSOCK -#define su_errno() (errno) -#define su_seterrno(n) ((errno = (n)), -1) -#endif - #if defined(__APPLE_CC__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) #ifndef EBADMSG #define EBADMSG EFAULT diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c b/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c index 7b888bbacc..3ab183edc0 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c @@ -157,4 +157,7 @@ const char *su_strerror(int errcode) return strerror(errcode); } +int su_errno(void) { return errno; } +int su_seterrno(int n) { errno = n; return -1; } + #endif /* SU_HAVE_WINSOCK */