Ardour  8.7-14-g57a6773833
ClassInfo.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 /*
3  https://github.com/vinniefalco/LuaBridge
4 
5  Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
6 
7  License: The MIT License (http://www.opensource.org/licenses/mit-license.php)
8 
9  Permission is hereby granted, free of charge, to any person obtaining a copy
10  of this software and associated documentation files (the "Software"), to deal
11  in the Software without restriction, including without limitation the rights
12  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13  copies of the Software, and to permit persons to whom the Software is
14  furnished to do so, subject to the following conditions:
15 
16  The above copyright notice and this permission notice shall be included in all
17  copies or substantial portions of the Software.
18 
19  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  SOFTWARE.
26 */
27 //==============================================================================
28 
29 #ifdef COMPILER_MSVC
30 #ifdef LIBARDOUR_DLL_EXPORTS
31 # define LuaBridge_API __declspec(dllexport)
32 #else
33 # define LuaBridge_API __declspec(dllimport)
34 #endif
35 #else
36 # define LuaBridge_API // mingw is sane WRT to static class members
37 #endif
38 
45 template <class T>
47 {
48 public:
49 #ifdef PLATFORM_WINDOWS
50  /* static symbols on windows (even identical symbols) are not
51  * mapped to the same address when mixing .dll + .exe.
52  * the implementation is moved to libardour/gtk2_ardour.
53  */
54  static void const* getStaticKey ();
55  static void const* getClassKey ();
56  static void const* getConstKey ();
57 #else
63  static void const* getStaticKey ()
64  {
65  static char value;
66  return &value;
67  }
68 
75  static void const* getClassKey ()
76  {
77  static char value;
78  return &value;
79  }
80 
86  static void const* getConstKey ()
87  {
88  static char value;
89  return &value;
90  }
91 #endif
92 };
93 
#define LuaBridge_API
Definition: ClassInfo.h:36
static void const * getStaticKey()
Definition: ClassInfo.h:63
static void const * getConstKey()
Definition: ClassInfo.h:86
static void const * getClassKey()
Definition: ClassInfo.h:75