Library of Assembled Shared Sources
lass_common.h
Go to the documentation of this file.
1/** @file
2 * @author Bram de Greve (bram@cocamware.com)
3 * @author Tom De Muer (tom@cocamware.com)
4 *
5 * *** BEGIN LICENSE INFORMATION ***
6 *
7 * The contents of this file are subject to the Common Public Attribution License
8 * Version 1.0 (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
10 * http://lass.sourceforge.net/cpal-license. The License is based on the
11 * Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover
12 * use of software over a computer network and provide for limited attribution for
13 * the Original Developer. In addition, Exhibit A has been modified to be consistent
14 * with Exhibit B.
15 *
16 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
17 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
18 * language governing rights and limitations under the License.
19 *
20 * The Original Code is LASS - Library of Assembled Shared Sources.
21 *
22 * The Initial Developer of the Original Code is Bram de Greve and Tom De Muer.
23 * The Original Developer is the Initial Developer.
24 *
25 * All portions of the code written by the Initial Developer are:
26 * Copyright (C) 2004-2025 the Initial Developer.
27 * All Rights Reserved.
28 *
29 * Contributor(s):
30 *
31 * Alternatively, the contents of this file may be used under the terms of the
32 * GNU General Public License Version 2 or later (the GPL), in which case the
33 * provisions of GPL are applicable instead of those above. If you wish to allow use
34 * of your version of this file only under the terms of the GPL and not to allow
35 * others to use your version of this file under the CPAL, indicate your decision by
36 * deleting the provisions above and replace them with the notice and other
37 * provisions required by the GPL License. If you do not delete the provisions above,
38 * a recipient may use your version of this file under either the CPAL or the GPL.
39 *
40 * *** END LICENSE INFORMATION ***
41 */
42
43
44
45/** @namespace lass
46 * @brief Library for Assembled Shared Sources
47 */
48
49
50
51/** @mainpage lass: Library of Assembled Shared Sources
52 * @author Bram de Greve (bram@www.cocamware.com)
53 * @author Tom De Muer (tom@www.cocamware.com)
54 *
55 * - lass::io: streams, binary streams, vrmlstreams, ...
56 * - lass::meta: a meta programming library for your cunning plans.
57 * - lass::num: numeric primitives and functions
58 * - lass::prim: geometric primitives
59 * - lass::python: creating links back and forth between C++ and Python
60 * - lass::spat: spatial subdivisions, quadtrees, octrees, meshes in 2D and 3D, triangulators, ...
61 * - lass::stde: std extensions often Python inspired in their nature
62 * - lass::util: general utility, debug facilities, ...
63 *
64 * Distributed under the terms of CPAL
65 *
66 * The LASS License:
67 *
68 * The contents of this file are subject to the Common Public Attribution License
69 * Version 1.0 (the "License"); you may not use this file except in compliance with
70 * the License. You may obtain a copy of the License at
71 * http://lass.cocamware.com/cpal-license. The License is based on the
72 * Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover
73 * use of software over a computer network and provide for limited attribution for
74 * the Original Developer. In addition, Exhibit A has been modified to be consistent
75 * with Exhibit B.
76 *
77 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
78 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
79 * language governing rights and limitations under the License.
80 *
81 * The Original Code is LASS - Library of Assembled Shared Sources.
82 *
83 * The Initial Developer of the Original Code is Bram de Greve and Tom De Muer.
84 * The Original Developer is the Initial Developer.
85 *
86 * All portions of the code written by the Initial Developer are:
87 * Copyright (C) 2004-2025 the Initial Developer.
88 * All Rights Reserved.
89 *
90 * Contributor(s):
91 *
92 * Alternatively, the contents of this file may be used under the terms of the
93 * GNU General Public License Version 2 or later (the GPL), in which case the
94 * provisions of GPL are applicable instead of those above. If you wish to allow use
95 * of your version of this file only under the terms of the GPL and not to allow
96 * others to use your version of this file under the CPAL, indicate your decision by
97 * deleting the provisions above and replace them with the notice and other
98 * provisions required by the GPL License. If you do not delete the provisions above,
99 * a recipient may use your version of this file under either the CPAL or the GPL.
100 *
101 */
102
103
104#ifndef LASS_GUARDIAN_OF_INCLUSION_LASS_COMMON_H
105#define LASS_GUARDIAN_OF_INCLUSION_LASS_COMMON_H
106
107#include "config/config.h"
108
109#define LASS_HEX_VERSION (LASS_MAJOR_VERSION << 16 | LASS_MINOR_VERSION << 8 | LASS_PATCHLEVEL)
110#define LASS_VERSION LASS_STRINGIFY(LASS_MAJOR_VERSION) "." LASS_STRINGIFY(LASS_MINOR_VERSION) "." LASS_STRINGIFY(LASS_PATCHLEVEL)
111
112#ifdef LASS_UTIL_THREAD_HAVE_POSIX
113# ifndef _REENTRANT
114# define _REENTRANT
115# endif
116#endif
117
118
119// --- Check if we have RTTI and warn if we don't ---
120
121// If you have the Intel C++ Compiler 7.1 installed, it screws up the part of MSVC's IDE
122// were you can enable RTTI. Therefore, you must add /GR to the commandline explicitely
123// http://tinyurl.com/8usvw
124#if !defined(_CPPRTTI) && LASS_COMPILER_TYPE == LASS_COMPILER_TYPE_MSVC
125# pragma message("[LASS BUILD MSG] RTTI not enabled ... Add /GR to commandline options if you need it.")
126#endif
127
128
129
130// --- Here we'll define some stuff on the name of libraries lass creates ---
131
132/** @def LASS_LIB_DEBUG
133 * @brief part of the library name that indicates if it is a release or debug build.
134 */
135#ifdef _DEBUG
136# define LASS_LIB_DEBUG "_d"
137#else
138# define LASS_LIB_DEBUG ""
139#endif
140
141
142/** @def LASS_DLL
143 * @brief DLL interface: import or export symbols? or neither?
144 */
145#ifdef LASS_DLL
146# undef LASS_DLL
147#endif
148#if LASS_SHARED_LIBRARY
149# if defined(LASS_EXPORTS) || defined (lass_EXPORTS)
150# define LASS_DLL LASS_DLL_EXPORT
151# else
152# define LASS_DLL LASS_DLL_IMPORT
153# endif
154#else
155# define LASS_DLL LASS_DLL_EXPORT
156#endif
157
158
159/** @def LASS_SIMD_ALIGN
160 * @brief if LASS_SIMD_ALIGNMENT is set, use LASS_SIMD_ALIGN to align some structures on SIMD alignment boundaries
161 */
162#if LASS_SIMD_ALIGNMENT
163# define LASS_SIMD_ALIGN LASS_ALIGN(LASS_SIMD_ALIGNMENT)
164#else
165# define LASS_SIMD_ALIGN
166#endif
167
168
169// --- frequently used STL mumbo jumbo ---
170
171#include <typeinfo>
172#include <exception>
173#include <stdexcept>
174
175#include <utility>
176#include <functional>
177#include <memory>
178
179#include <string>
180
181#include <locale>
182
183#include <vector>
184#include <list>
185#include <deque>
186#include <map>
187#include <set>
188
189#include <iterator>
190
191#include <algorithm>
192
193#include <complex>
194#include <numeric>
195
196#include <iostream>
197#include <fstream>
198#include <sstream>
199#include <iomanip>
200
201
202
203// --- common lass stuff ---
204
205#include "util/common_macros.h"
206#include "util/call_traits.h"
207#include "util/exception.h"
208#include "util/enforcer.h"
209#include "util/string_cast.h"
210#include "io/io_fwd.h"
211#include "io/proxy_man.h"
212#include "stde/extended_io.h"
213
214#endif