Luna/libc/include/bits/errno-return.h

17 lines
1.0 KiB
C
Raw Normal View History

#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