gwnavruntime/basesystem/checkheaderlibdesync.h Source File

checkheaderlibdesync.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 // primary contact: GUAL - secondary contact: NOBODY
8 #ifndef Navigation_CheckHeaderLibDesync_H
9 #define Navigation_CheckHeaderLibDesync_H
10 
11 
12 
17 
18 namespace Kaim
19 {
20 
21 // Declare a function whose implementation only exists in gwnavruntime library.
22 void KY_CHECK_MATCHING_VERSION_FUNCTION_NAME();
23 
26 {
27 public:
47  KY_INLINE static void Check()
48  {
49  // This check that used libraries are in sync with defined macros.
50  CheckBuildMode();
51 
52  // This ensure there's no mismatch between header files and libraries.
53  CheckHeaderVsLibraryVersions();
54  }
55 
56 
57 private:
58  KY_INLINE static void CheckHeaderVsLibraryVersions()
59  {
60  KY_CHECK_MATCHING_VERSION_FUNCTION_NAME();
61  }
62 
63 
64  KY_INLINE static void CheckBuildMode()
65  {
66 #if defined(KY_BUILD_DEBUG)
67  Check_DEBUG();
68 #elif defined(KY_BUILD_RELEASE)
69  Check_RELEASE();
70 #elif defined(KY_BUILD_SHIPPING)
72 #else
73 KY_COMPILE_TIME_MESSAGE("Please define KY_BUILD_DEBUG, KY_BUILD_RELEASE or KY_BUILD_SHIPPING, accordingly to the Gameware Navigation libraries you are linking against (debug, release or shipping respectively)");
74 KY_COMPILER_ASSERT(0);
75 #endif
76  }
77 
78  static void Check_DEBUG();
79  static void Check_RELEASE();
80  static void Check_SHIPPING();
81  static KyUInt32 s_dummy;
82 };
83 
84 }
85 
86 #endif
static void Check_DEBUG()
cf. CheckHeaderLibDesync::Check for more information
static void Check_RELEASE()
cf. CheckHeaderLibDesync::Check for more information
static void Check()
This is called in user code thanks to BaseSystem::Init.
Definition: checkheaderlibdesync.h:52
static void Check_SHIPPING()
cf. CheckHeaderLibDesync::Check for more information
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
This class helps to finding errors in the use of header files and libraries.
Definition: checkheaderlibdesync.h:25