1/* ----------------------------------------------------------------------------
2
3 * GTSAM_UNSTABLE Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
12/**
13 * @file dllexport.h
14 * @brief Symbols for exporting classes and methods from DLLs
15 * @author Richard Roberts
16 * @date Mar 9, 2013
17 */
18
19// Macros for exporting DLL symbols on Windows
20// Usage example:
21// In header file:
22// class GTSAM_EXPORT MyClass { ... };
23//
24// Results in the following declarations:
25// When included while compiling the GTSAM library itself:
26// class __declspec(dllexport) MyClass { ... };
27// When included while compiling other code against GTSAM:
28// class __declspec(dllimport) MyClass { ... };
29
30#pragma once
31
32// Whether GTSAM is compiled as static or DLL in windows.
33// This will be used to decide whether include __declspec(dllimport) or not in headers
34#define GTSAM_SHARED_LIB
35
36#ifdef _WIN32
37# ifndef GTSAM_SHARED_LIB
38# define GTSAM_UNSTABLE_EXPORT
39# define GTSAM_UNSTABLE_EXTERN_EXPORT extern
40# else
41# ifdef GTSAM_UNSTABLE_EXPORTS
42# define GTSAM_UNSTABLE_EXPORT __declspec(dllexport)
43# define GTSAM_UNSTABLE_EXTERN_EXPORT __declspec(dllexport) extern
44# else
45# define GTSAM_UNSTABLE_EXPORT __declspec(dllimport)
46# define GTSAM_UNSTABLE_EXTERN_EXPORT __declspec(dllimport)
47# endif
48# endif
49#else
50#ifdef __APPLE__
51# define GTSAM_UNSTABLE_EXPORT __attribute__((visibility("default")))
52# define GTSAM_UNSTABLE_EXTERN_EXPORT extern
53#else
54# define GTSAM_UNSTABLE_EXPORT
55# define GTSAM_UNSTABLE_EXTERN_EXPORT extern
56#endif
57#endif
58
59#undef GTSAM_SHARED_LIB
60
61