Tree-wide cleanup of trailing whitespace
[barry.git] / src / dll.h
blobf0202e58137164524b1dc599f008e855ef8360e6
1 ///
2 /// \file dll.h
3 /// Macros for handling DLL/library API visibility
4 ///
5 /// Based on documentation at: http://gcc.gnu.org/wiki/Visibility
6 ///
8 /*
9 Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 See the GNU General Public License in the COPYING file at the
21 root directory of this project for more details.
24 #ifndef __BARRY_DLL_H__
25 #define __BARRY_DLL_H__
29 // Every non-templated class that is meant to be used by an application
30 // must be declared as:
32 // class BXEXPORT ClassName {};
34 // Every private (not protected or public) member function of an exported
35 // class can be declared as:
37 // private:
38 // BXLOCAL void HelperFunc();
40 // Every non-templated function that is meant to be used by an application
41 // must be declared as:
43 // BXEXPORT int GetAmount();
44 // BXEXPORT std::ostream& operator<< (std::ostream& os, const Obj &obj);
47 // Everything else will be hidden, as per the build system's configuration.
51 #if __BARRY_HAVE_GCCVISIBILITY__
53 #define BXEXPORT __attribute__ ((visibility("default")))
54 #define BXLOCAL __attribute__ ((visibility("hidden")))
56 #else
58 #define BXEXPORT
59 #define BXLOCAL
61 #endif
63 #endif