VSM C++ SDK
Vehicle Specific Modules SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
defs.h
Go to the documentation of this file.
1 // Copyright (c) 2018, Smart Projects Holdings Ltd
2 // All rights reserved.
3 // See LICENSE file for license details.
4 
10 #ifndef _UGCS_VSM_DEFS_H_
11 #define _UGCS_VSM_DEFS_H_
12 
16 // XXX ifdef GCC
17 #ifdef __unix__
18 #define __FORMAT(type, fmt_idx, arg_idx) \
19  __attribute__((format(type, fmt_idx, arg_idx)))
20 #else /* __unix__ */
21 /* Windows has improper size of long type which causes undesired warning.
22  * Disable format validation there.
23  */
24 #define __FORMAT(type, fmt_idx, arg_idx)
25 #endif /* __unix__ */
26 
30 #define __UNUSED __attribute__((unused))
31 
35 #define __PACKED __attribute__((packed))
36 
37 // Use this to define function to get VSM name. It is used by SDK when registering VSM with server.
38 // It must be defined in VSM sources (typically in main.cpp)
39 // Otherwise there will be an undefined reference linker error against Get_vsm_name().
40 
41 // DEFINE_DEFAULT_VSM_NAME returns the CMAKE_PROJECT_NAME defined by SDK buildsystem.
42 #define DEFINE_DEFAULT_VSM_NAME namespace ugcs{namespace vsm{const char* Get_vsm_name() {return VSM_PROJECT_NAME;}}}
43 
44 // DEFINE_VSM_NAME can be used instead to override the default VSM name
45 #define DEFINE_VSM_NAME(x) namespace ugcs{namespace vsm{const char* Get_vsm_name() {return x;}}}
46 
47 #endif /* _UGCS_VSM_DEFS_H_ */