1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 *  Copyright (c) 2008, Willow Garage, Inc.
5 *  All rights reserved.
6 *
7 *  Redistribution and use in source and binary forms, with or without
8 *  modification, are permitted provided that the following conditions
9 *  are met:
10 *
11 *   * Redistributions of source code must retain the above copyright
12 *     notice, this list of conditions and the following disclaimer.
13 *   * Redistributions in binary form must reproduce the above
14 *     copyright notice, this list of conditions and the following
15 *     disclaimer in the documentation and/or other materials provided
16 *     with the distribution.
17 *   * Neither the name of the Willow Garage nor the names of its
18 *     contributors may be used to endorse or promote products derived
19 *     from this software without specific prior written permission.
20 *
21 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 *  POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 /* Author: Thomas Moulard */
36 
37 #ifndef URDFDOM_EXPORTDECL_H
38 # define URDFDOM_EXPORTDECL_H
39 
40 // Handle portable symbol export.
41 // Defining manually which symbol should be exported is required
42 // under Windows whether MinGW or MSVC is used.
43 //
44 // The headers then have to be able to work in two different modes:
45 // - dllexport when one is building the library,
46 // - dllimport for clients using the library.
47 //
48 // On Linux, set the visibility accordingly. If C++ symbol visibility
49 // is handled by the compiler, see: http://gcc.gnu.org/wiki/Visibility
50 # if defined _WIN32 || defined __CYGWIN__
51 // On Microsoft Windows, use dllimport and dllexport to tag symbols.
52 #  define URDFDOM_DLLIMPORT __declspec(dllimport)
53 #  define URDFDOM_DLLEXPORT __declspec(dllexport)
54 #  define URDFDOM_DLLLOCAL
55 # else
56 // On Linux, for GCC >= 4, tag symbols using GCC extension.
57 #  if __GNUC__ >= 4
58 #   define URDFDOM_DLLIMPORT __attribute__ ((visibility("default")))
59 #   define URDFDOM_DLLEXPORT __attribute__ ((visibility("default")))
60 #   define URDFDOM_DLLLOCAL  __attribute__ ((visibility("hidden")))
61 #  else
62 // Otherwise (GCC < 4 or another compiler is used), export everything.
63 #   define URDFDOM_DLLIMPORT
64 #   define URDFDOM_DLLEXPORT
65 #   define URDFDOM_DLLLOCAL
66 #  endif // __GNUC__ >= 4
67 # endif // defined _WIN32 || defined __CYGWIN__
68 
69 # ifdef URDFDOM_STATIC
70 // If one is using the library statically, get rid of
71 // extra information.
72 #  define URDFDOM_DLLAPI
73 #  define URDFDOM_LOCAL
74 # else
75 // Depending on whether one is building or using the
76 // library define DLLAPI to import or export.
77 #  ifdef URDFDOM_EXPORTS
78 #   define URDFDOM_DLLAPI URDFDOM_DLLEXPORT
79 #  else
80 #   define URDFDOM_DLLAPI URDFDOM_DLLIMPORT
81 #  endif // URDFDOM_EXPORTS
82 #  define URDFDOM_LOCAL URDFDOM_DLLLOCAL
83 # endif // URDFDOM_STATIC
84 #endif //! URDFDOM_EXPORTDECL_H
85