1 /* 2 * Copyright 2011, Oliver Tappe, zooey@hirschkaefer.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _ERRNO_PRIVATE_H 6 #define _ERRNO_PRIVATE_H 7 8 9 #include <errno.h> 10 11 //#define TRACE_ERRNO 12 13 #if defined(TRACE_ERRNO) && !defined(_KERNEL_MODE) 14 # include <OS.h> 15 # define __set_errno(x) \ 16 do { \ 17 int error = (x); \ 18 debug_printf("%s:%d - setting errno to %x\n", __FILE__, __LINE__, \ 19 error); \ 20 errno = error; \ 21 } while (0) 22 #else 23 # define __set_errno(x) \ 24 do { errno = (x); } while (0) 25 #endif 26 27 28 #endif // _ERRNO_PRIVATE_H 29