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>2014-08-15 17:50:53 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-08-15 17:50:53 +0400
commitfc15ff2f0dbcf759e2a5e9cdf648ba0241535e12 (patch)
tree24771bd0b13391981736e0ba6e88a69810df17f8 /winsup
parent1b580c732ad14228f5b28897523e61d9d49537fd (diff)
* cygerrno.h (seterrno): Define as (always) inline function.
* errno.cc (seterrno): Remove.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/cygerrno.h11
-rw-r--r--winsup/cygwin/errno.cc9
3 files changed, 14 insertions, 11 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ce72ed10e..0da8f287c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygerrno.h (seterrno): Define as (always) inline function.
+ * errno.cc (seterrno): Remove.
+
2014-08-14 Corinna Vinschen <corinna@vinschen.de>
* dll_init.sgml: Remove.
diff --git a/winsup/cygwin/cygerrno.h b/winsup/cygwin/cygerrno.h
index 337dd75fc..b9ec7b61d 100644
--- a/winsup/cygwin/cygerrno.h
+++ b/winsup/cygwin/cygerrno.h
@@ -1,7 +1,7 @@
/* cygerrno.h: main Cygwin header file.
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2010, 2011, 2012, 2013
- Red Hat, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2010, 2011, 2012, 2013,
+ 2014 Red Hat, Inc.
This file is part of Cygwin.
@@ -16,10 +16,15 @@ details. */
void __reg3 seterrno_from_win_error (const char *file, int line, DWORD code);
void __reg3 seterrno_from_nt_status (const char *file, int line, NTSTATUS status);
-void __reg2 seterrno (const char *, int line);
int __reg2 geterrno_from_win_error (DWORD code = GetLastError (), int deferrno = 13 /*EACCESS*/);
int __reg2 geterrno_from_nt_status (NTSTATUS status, int deferrno = 13 /*EACCESS*/);
+inline void __attribute__ ((always_inline))
+seterrno (const char *file, int line)
+{
+ seterrno_from_win_error (file, line, GetLastError ());
+}
+
#define __seterrno() seterrno (__FILE__, __LINE__)
#define __seterrno_from_win_error(val) seterrno_from_win_error (__FILE__, __LINE__, val)
#define __seterrno_from_nt_status(status) seterrno_from_nt_status (__FILE__, __LINE__, status)
diff --git a/winsup/cygwin/errno.cc b/winsup/cygwin/errno.cc
index a87a11564..589410a9a 100644
--- a/winsup/cygwin/errno.cc
+++ b/winsup/cygwin/errno.cc
@@ -1,7 +1,7 @@
/* errno.cc: errno-related functions
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
This file is part of Cygwin.
@@ -363,13 +363,6 @@ seterrno_from_nt_status (const char *file, int line, NTSTATUS status)
errno = _impure_ptr->_errno = geterrno_from_win_error (code, EACCES);
}
-/* seterrno: Set `errno' based on GetLastError (). */
-void __reg2
-seterrno (const char *file, int line)
-{
- seterrno_from_win_error (file, line, GetLastError ());
-}
-
static char *
strerror_worker (int errnum)
{