From fc15ff2f0dbcf759e2a5e9cdf648ba0241535e12 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 15 Aug 2014 13:50:53 +0000 Subject: [PATCH] * cygerrno.h (seterrno): Define as (always) inline function. * errno.cc (seterrno): Remove. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/cygerrno.h | 11 ++++++++--- winsup/cygwin/errno.cc | 9 +-------- 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 + + * cygerrno.h (seterrno): Define as (always) inline function. + * errno.cc (seterrno): Remove. + 2014-08-14 Corinna Vinschen * 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) {