vmmlib  1.7.0
 All Classes Namespaces Functions Pages
vmmlib_config.hpp
1 /*
2  * Copyright (c) 2006-2014, Visualization and Multimedia Lab,
3  * University of Zurich <http://vmml.ifi.uzh.ch>,
4  * Eyescale Software GmbH,
5  * Blue Brain Project, EPFL
6  *
7  * This file is part of VMMLib <https://github.com/VMML/vmmlib/>
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * Redistributions of source code must retain the above copyright notice, this
13  * list of conditions and the following disclaimer. Redistributions in binary
14  * form must reproduce the above copyright notice, this list of conditions and
15  * the following disclaimer in the documentation and/or other materials provided
16  * with the distribution. Neither the name of the Visualization and Multimedia
17  * Lab, University of Zurich nor the names of its contributors may be used to
18  * endorse or promote products derived from this software without specific prior
19  * written permission.
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef __VMML__VMMLIB_CONFIG__HPP__
33 #define __VMML__VMMLIB_CONFIG__HPP__
34 
35 // #define VMMLIB_NO_SFINAE
36 
37 #ifdef _MSC_VER
38 # ifndef HAVE_SSIZE_T
39 # include <basetsd.h>
40 typedef SSIZE_T ssize_t;
41 # define HAVE_SSIZE_T
42 # endif
43 #endif
44 
45 // enabling this switch will have the following effect:
46 // operator T* will not be compiled, but for vectors,
47 // operator[] will instead be used. This means you can
48 // use vec[2] as before, but things like glVertex3fv( vec )
49 // will not work anymore.
50 //#define VMMLIB_NO_CONVERSION_OPERATORS
51 
52 // enabling will align the data of vector, frustum and matrix to the given value
53 // Note: This won't work if other libraries in your application are also using
54 // vmmlib with a different alignment. vmmlib won't check this.
55 //#define VMMLIB_FORCE_ALIGNMENT 16
56 
57 #ifndef VMMLIB_CUSTOM_CONFIG
58 # ifndef NDEBUG
59 # define VMMLIB_SAFE_ACCESSORS
60 # endif
61 # define VMMLIB_THROW_EXCEPTIONS
62 #endif
63 
64 #ifdef VMMLIB_FORCE_ALIGNMENT
65 # ifdef __GNUC__
66 # define VMMLIB_ALIGN( var ) var __attribute__((aligned(VMMLIB_FORCE_ALIGNMENT)))
67 # elif defined WIN32
68 # define VMMLIB_ALIGN( var ) __declspec (align (VMMLIB_FORCE_ALIGNMENT)) var
69 # else
70 # error "Alignment macro undefined"
71 # endif
72 #else
73 # define VMMLIB_ALIGN( var ) var
74 #endif
75 
76 #endif