libvisiontransfer  10.6.0
common.h
1 /*******************************************************************************
2  * Copyright (c) 2023 Allied Vision Technologies GmbH
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *******************************************************************************/
14 
15 #ifndef VISIONTRANSFER_COMMON_H
16 #define VISIONTRANSFER_COMMON_H
17 
18 #define VISIONTRANSFER_MAJOR_VERSION 0
19 #define VISIONTRANSFER_MINOR_VERSION 0
20 #define VISIONTRANSFER_PATCH_VERSION 0
21 
22 #ifdef _MSC_VER
23  // Visual studio needs an explicit export statement
24 # define VT_EXPORT __declspec(dllexport)
25 #else
26 # define VT_EXPORT
27 #endif
28 
29 // Macro for marking functions / variables as deprecated
30 #ifdef VISIONTRANSFER_NO_DEPRECATION_WARNINGS
31  // For referencing all of our own code (e.g. for Python wrapper)
32 # define DEPRECATED(msg)
33 #else
34 # if __cplusplus >= 201402L
35 # define DEPRECATED(msg) [[deprecated(msg)]]
36 # elif defined(__GNUC__) || defined(__clang__)
37 # define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
38 # elif defined(_MSC_VER)
39 # define DEPRECATED(msg) __declspec(deprecated(msg))
40 # else
41 # define DEPRECATED(msg)
42 # endif
43 #endif
44 
45 #ifndef _MSC_VER
46 #ifndef VISIONTRANSFER_NO_OLD_ABI_WARNING
47 # // Warn for old glibc++ ABI, unless it's our own internal compatibility build
48 # if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0
49 # warning "CAUTION: You are using _GLIBCXX_USE_CXX11_ABI=0. Make sure to link a libvisiontransfer built with the same setting."
50 # endif
51 #endif
52 #endif
53 
54 // C++ version; special case for VS instead of demanding /Z:__cplusplus
55 #if defined(_MSVC_LANG)
56 #define VISIONTRANSFER_CPLUSPLUS_VERSION _MSVC_LANG
57 #else
58 #define VISIONTRANSFER_CPLUSPLUS_VERSION __cplusplus
59 #endif
60 
61 #endif
Allied Vision