Anonymizer  4.0
SDK for anonymization of human faces and licence plates in images.
 All Data Structures Functions Variables Typedefs Groups Pages
explink.h
1 /* **************************************************************** */
2 /* **************************************************************** */
3 /* * * */
4 /* * Support header file to Anonymizer library * */
5 /* * for explicit linking 2016-10-06 * */
6 /* * -------------------------------------------------------- * */
7 /* * * */
8 /* * Eyedea Recognition, Ltd. (C) 2015 * */
9 /* * * */
10 /* * Contact: * */
11 /* * web: http://www.eyedea.cz * */
12 /* * email: info@eyedea.cz * */
13 /* * * */
14 /* **************************************************************** */
15 /* **************************************************************** */
16 
17 #ifndef _EXPLINK_H_
18 #define _EXPLINK_H_
19 
20 
21 #ifdef _DOXYGEN_ /* documentation */
22 
31 #define LIB_PREFFIX
32 
37 #define LIB_EXT
38 
43 #define LIB_TARGET
44 
51 #define OPEN_SHLIB(shlib_hnd, shlib_filename)
52 
61 #define LOAD_SHFCN(shfcn_ptr, shfcn_type, shlib_hnd, shfcn_name)
62 
66 #define FREE_LIB(shlib_hnd)
67 
69 #else
70 
71 
72 #if _WIN32 || _WIN64 /* WINDOWS Platform */
73 /* Standard includes */
74 # include <windows.h>
75 # include <direct.h>
76 # include <io.h>
77 typedef HMODULE shlib_hnd; /* type definition of shared lib. handle */
78 /* Shared lib. open and function load routines. */
79 # define OPEN_SHLIB(shlib_hnd, shlib_filename) shlib_hnd = LoadLibrary(shlib_filename)
80 # define LOAD_SHFCN(shfcn_ptr, shfcn_type, shlib_hnd, shfcn_name) shfcn_ptr = (shfcn_type) GetProcAddress(shlib_hnd, shfcn_name)
81 # define FREE_LIB(shlib_hnd) FreeLibrary(shlib_hnd)
82 # define LIB_PREFFIX
83 # define LIB_EXT ".dll"
84 # if _WIN64
85 # define LIB_TARGET "x64"
86 # else
87 # define LIB_TARGET "Win32"
88 # endif
89 #elif __linux__ || __unix /* LINUX/UNIX Platforms */
90 /* Standard includes */
91 # include <dlfcn.h>
92 typedef void* shlib_hnd; /* type definition of shared lib. handle */
93 /* Shared lib. open and function load routines. */
94 # define OPEN_SHLIB(shlib_hnd, shlib_filename) shlib_hnd = dlopen(shlib_filename,RTLD_LAZY)
95 # define LOAD_SHFCN(shfcn_ptr, shfcn_type, shlib_hnd, shfcn_name) shfcn_ptr = (shfcn_type) dlsym(shlib_hnd, shfcn_name)
96 # define FREE_LIB(shlib_hnd) dlclose(shlib_hnd)
97 # define LIB_PREFFIX "lib"
98 # define LIB_EXT ".so"
99 # if defined(__x86_64__) || defined(_M_X64) || defined(__ppc64__)
100 # define LIB_TARGET "x86_64"
101 # else
102 # define LIB_TARGET x86_32
103 # endif
104 #else
105 # error Unkown platform
106 #endif /* Multiplatform defines */
107 
108 #endif
109 
110 #endif