Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:05

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 #ifndef CATCH_ERRNO_GUARD_HPP_INCLUDED
0009 #define CATCH_ERRNO_GUARD_HPP_INCLUDED
0010 
0011 namespace Catch {
0012 
0013     //! Simple RAII class that stores the value of `errno`
0014     //! at construction and restores it at destruction.
0015     class ErrnoGuard {
0016     public:
0017         // Keep these outlined to avoid dragging in macros from <cerrno>
0018 
0019         ErrnoGuard();
0020         ~ErrnoGuard();
0021     private:
0022         int m_oldErrno;
0023     };
0024 
0025 }
0026 
0027 #endif // CATCH_ERRNO_GUARD_HPP_INCLUDED