Blame lib/msvc-nothrow.h

Packit Service fdd496
/* Wrappers that don't throw invalid parameter notifications
Packit Service fdd496
   with MSVC runtime libraries.
Packit Service fdd496
   Copyright (C) 2011-2017 Free Software Foundation, Inc.
Packit Service fdd496
Packit Service fdd496
   This program is free software; you can redistribute it and/or modify
Packit Service fdd496
   it under the terms of the GNU General Public License as published by
Packit Service fdd496
   the Free Software Foundation; either version 3, or (at your option)
Packit Service fdd496
   any later version.
Packit Service fdd496
Packit Service fdd496
   This program is distributed in the hope that it will be useful,
Packit Service fdd496
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fdd496
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service fdd496
   GNU General Public License for more details.
Packit Service fdd496
Packit Service fdd496
   You should have received a copy of the GNU General Public License along
Packit Service fdd496
   with this program; if not, see <http://www.gnu.org/licenses/>.  */
Packit Service fdd496
Packit Service fdd496
#ifndef _MSVC_NOTHROW_H
Packit Service fdd496
#define _MSVC_NOTHROW_H
Packit Service fdd496
Packit Service fdd496
/* With MSVC runtime libraries with the "invalid parameter handler" concept,
Packit Service fdd496
   functions like fprintf(), dup2(), or close() crash when the caller passes
Packit Service fdd496
   an invalid argument.  But POSIX wants error codes (such as EINVAL or EBADF)
Packit Service fdd496
   instead.
Packit Service fdd496
   This file defines wrappers that turn such an invalid parameter notification
Packit Service fdd496
   into an error code.  */
Packit Service fdd496
Packit Service fdd496
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
Packit Service fdd496
Packit Service fdd496
/* Get original declaration of _get_osfhandle.  */
Packit Service fdd496
# include <io.h>
Packit Service fdd496
Packit Service fdd496
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
Packit Service fdd496
Packit Service fdd496
/* Override _get_osfhandle.  */
Packit Service fdd496
extern intptr_t _gl_nothrow_get_osfhandle (int fd);
Packit Service fdd496
#  define _get_osfhandle _gl_nothrow_get_osfhandle
Packit Service fdd496
Packit Service fdd496
# endif
Packit Service fdd496
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
#endif /* _MSVC_NOTHROW_H */