XRTraits C++ OpenXR Utilities
GSLWrap.h
Go to the documentation of this file.
1 // Copyright 2018-2019, Collabora, Ltd.
2 // SPDX-License-Identifier: BSL-1.0
3 /*!
4  * @file
5  * @brief Header wrapping or stubbing GSL
6  * @author Ryan Pavlik <ryan.pavlik@collabora.com>
7  */
8 
9 #pragma once
10 
11 #ifdef XRTRAITS_USE_GSL
12 #include <gsl/gsl>
13 #else
14 
15 #include <assert.h>
16 
17 // Nearly no-op definitions
18 
19 /*! When GSL is available, normally tells the optimizer to assume the condition
20  * is true.
21  */
22 #ifndef GSL_ASSUME
23 #define GSL_ASSUME(X) assert(X)
24 #endif // !GSL_ASSUME
25 
26 //! When GSL is available, normally asserts a precondition.
27 
28 #ifndef Expects
29 #define Expects(X) assert(X)
30 #endif // !Expects
31 
32 #endif