Luna/libc/include/bits/errno-return.h
apio 8838e2cf22
Some checks failed
continuous-integration/drone/push Build is failing
Bring back the OS-Specific Toolchain on restart :^)
2023-01-06 17:35:07 +01:00

17 lines
1.0 KiB
C

#ifndef _BITS_ERRNO_RETURN_H
#define _BITS_ERRNO_RETURN_H
#include <errno.h>
#define __errno_return(value, type) \
do { \
if (value < 0) \
{ \
errno = (int)(-value); \
return (type)-1; \
} \
return (type)value; \
} while (0)
#endif