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