Panda3D

intnames.h
Go to the documentation of this file.
1 /**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file intnames.h
10 * @author rdb
11 * @date 2014-06-07
12 */
13
14 /*
15 * This file is used throughout this directory, in conjunction with
16 * dblnames.h, to implement a poor man's template of the linmath objects on
17 * numeric type. The idea is to #include either fltnames.h or dblnames.h (or,
18 * in theory, intnames.h or any other numeric type we wanted to implement) and
19 * then to include the various *_src.h andor *_src.cxx files that actually
20 * define the linmath objects. We do this instead of using actual templates
21 * to avoid some of the inherent problems with templates: compiler complexity
22 * and distributed code bloat, for instance; plus it allows us to implement
23 * if-based specialization on numeric type for compilers (like VC++) that
24 * don't completely support template specialization. That and the fact that
25 * VC++ seems to have a particularly bad time with templates in general.
26 */
27
28
29 #undef FLOATTYPE
30 #undef FLOATNAME
31 #undef FLOATTOKEN
32 #undef FLOATCONST
33 #undef FLOATTYPE_IS_INT
34 #undef STRINGIFY
35 #undef FLOATNAME_STR
36
37 #define FLOATTYPE int
38 #define FLOATNAME(ARG) ARG##i
39 #define FLOATTOKEN 'i'
40 #define FLOATCONST(ARG) ARG
41 #define FLOATTYPE_IS_INT
42
43 #define STRINGIFY(ARG) #ARG
44 #define FLOATNAME_STR(ARG) STRINGIFY(ARG##i)