Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-05-04 15:00:22 +0400
committerCorinna Vinschen <corinna@vinschen.de>2005-05-04 15:00:22 +0400
commit5d4750a99625a94f2e899824957b7d71406aa57b (patch)
treedafacfa62f8fed5c1b09cccf25b967f37f108a68 /winsup
parentf3b00363042bd97ec1adebc976ef4012d93142f1 (diff)
* 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.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/cygerrno.h12
-rw-r--r--winsup/cygwin/debug.cc8
3 files changed, 13 insertions, 13 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9eb464a95..7d1b9942d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/winsup/cygwin/cygerrno.h b/winsup/cygwin/cygerrno.h
index f3be0ce1b..1c0ef70fe 100644
--- a/winsup/cygwin/cygerrno.h
+++ b/winsup/cygwin/cygerrno.h
@@ -23,12 +23,14 @@ int __stdcall geterrno_from_win_error (DWORD code, int deferrno) __attribute__ (
__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);
diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc
index ad493cd9d..b7c2b59b4 100644
--- a/winsup/cygwin/debug.cc
+++ b/winsup/cygwin/debug.cc
@@ -230,12 +230,4 @@ close_handle (const char *func, int ln, HANDLE h, const char *name, bool force)
#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*/