+2005-05-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygerrno.h (__set_errno): Define as inline function here.
+ (set_errno): Always define as call to __set_errno.
+ * debug.cc (__set_errno): Move to cygerrno.h.
+
2005-05-03 Christopher Faylor <cgf@timesys.com>
* shared.cc (user_shared_initialize): Rework locking so that nothing is
__seterrno_from_win_error (winerr); \
})
-#ifndef DEBUGGING
-#define set_errno(val) (errno = _impure_ptr->_errno = (val))
-#else
-int __stdcall __set_errno (const char *ln, int ln, int val) __attribute ((regparm(3)));
+inline int
+__set_errno (const char *fn, int ln, int val)
+{
+ debug_printf ("%s:%d val %d", fn, ln, val);
+ return errno = _impure_ptr->_errno = (val);
+}
#define set_errno(val) __set_errno (__PRETTY_FUNCTION__, __LINE__, (val))
-#endif
+
#define get_errno() (errno)
extern "C" void __stdcall set_sig_errno (int e);
#endif
return ret;
}
-
-int __stdcall
-__set_errno (const char *func, int ln, int val)
-{
- debug_printf ("%s:%d val %d", func, ln, val);
- _impure_ptr->_errno = val;
- return errno = val;
-}
#endif /*DEBUGGING*/