TVM  0.9.4
api.h
Go to the documentation of this file.
1 
3 #pragma once
4 
5 #if defined _WIN32 || defined __CYGWIN__
6 // On Microsoft Windows, use dllimport and dllexport to tag symbols.
7 # define TVM_DLLIMPORT __declspec(dllimport)
8 # define TVM_DLLEXPORT __declspec(dllexport)
9 # define TVM_DLLLOCAL
10 #else
11 // On Linux, for GCC >= 4, tag symbols using GCC extension.
12 # if __GNUC__ >= 4
13 # define TVM_DLLIMPORT __attribute__((visibility("default")))
14 # define TVM_DLLEXPORT __attribute__((visibility("default")))
15 # define TVM_DLLLOCAL __attribute__((visibility("hidden")))
16 # else
17 // Otherwise (GCC < 4 or another compiler is used), export everything.
18 # define TVM_DLLIMPORT
19 # define TVM_DLLEXPORT
20 # define TVM_DLLLOCAL
21 # endif // __GNUC__ >= 4
22 #endif // defined _WIN32 || defined __CYGWIN__
23 
24 #ifdef TVM_STATIC
25 // If one is using the library statically, get rid of
26 // extra information.
27 # define TVM_DLLAPI
28 # define TVM_LOCAL
29 #else
30 // Depending on whether one is building or using the
31 // library define DLLAPI to import or export.
32 # ifdef TVM_EXPORTS
33 # define TVM_DLLAPI TVM_DLLEXPORT
34 # else
35 # define TVM_DLLAPI TVM_DLLIMPORT
36 # endif // TVM_EXPORTS
37 # define TVM_LOCAL TVM_DLLLOCAL
38 #endif // TVM_STATIC