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