mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-01 11:02:53 +00:00
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.
This commit is contained in:
parent
43f2c89a08
commit
c01a142665
@ -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
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user