gwnavruntime/basesystem/checkheaderlibdesync.h Source File

checkheaderlibdesync.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
9 
10 
15 
16 namespace Kaim
17 {
18 
19 // Declare a function whose implementation only exists in gwnavruntime library.
20 void KY_CHECK_MATCHING_VERSION_FUNCTION_NAME();
21 
24 {
25 public:
45  KY_INLINE static void Check()
46  {
47  // This check that used libraries are in sync with defined macros.
48  CheckBuildMode();
49 
50  // This ensure there's no mismatch between header files and libraries.
51  CheckHeaderVsLibraryVersions();
52  }
53 
54 
55 private:
56  KY_INLINE static void CheckHeaderVsLibraryVersions()
57  {
58  KY_CHECK_MATCHING_VERSION_FUNCTION_NAME();
59  }
60 
61  KY_INLINE static void CheckBuildMode()
62  {
63  #if defined(KY_CONFIG_DEBUG)
64  Check_DEBUG();
65  #elif defined(KY_CONFIG_DEV)
66  Check_DEV();
67  #elif defined(KY_CONFIG_RELEASE)
68  Check_RELEASE();
69  #else
70  static_assert(0, "Please define KY_CONFIG_DEBUG, KY_CONFIG_DEV or KY_CONFIG_RELEASE, accordingly to the Autodesk Navigation libraries you are linking against (debug, dev or release respectively)");
71  #endif
72  }
73 
74  static void Check_DEBUG();
75  static void Check_DEV();
76  static void Check_RELEASE();
77  static KyUInt32 s_dummy;
78 };
79 
80 }
81 
static void Check_DEBUG()
cf. CheckHeaderLibDesync::Check for more information
static void Check_DEV()
cf. CheckHeaderLibDesync::Check for more information
static void Check()
This is called in user code thanks to BaseSystem::Init.
Definition: checkheaderlibdesync.h:45
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
This class helps to finding errors in the use of header files and libraries.
Definition: checkheaderlibdesync.h:23
static void Check_RELEASE()
cf. CheckHeaderLibDesync::Check for more information
Definition: checkheaderlibdesync.cpp:19