00001 /// 00002 /// \file dll.h 00003 /// Macros for handling DLL/library API visibility 00004 /// 00005 /// Based on documentation at: http://gcc.gnu.org/wiki/Visibility 00006 /// 00007 00008 /* 00009 Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/) 00010 00011 This program is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 This program is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00019 00020 See the GNU General Public License in the COPYING file at the 00021 root directory of this project for more details. 00022 */ 00023 00024 #ifndef __BARRY_DLL_H__ 00025 #define __BARRY_DLL_H__ 00026 00027 // 00028 // 00029 // Every non-templated class that is meant to be used by an application 00030 // must be declared as: 00031 // 00032 // class BXEXPORT ClassName {}; 00033 // 00034 // Every private (not protected or public) member function of an exported 00035 // class can be declared as: 00036 // 00037 // private: 00038 // BXLOCAL void HelperFunc(); 00039 // 00040 // Every non-templated function that is meant to be used by an application 00041 // must be declared as: 00042 // 00043 // BXEXPORT int GetAmount(); 00044 // BXEXPORT std::ostream& operator<< (std::ostream& os, const Obj &obj); 00045 // 00046 // 00047 // Everything else will be hidden, as per the build system's configuration. 00048 // 00049 // 00050 00051 #if __BARRY_HAVE_GCCVISIBILITY__ 00052 00053 #define BXEXPORT __attribute__ ((visibility("default"))) 00054 #define BXLOCAL __attribute__ ((visibility("hidden"))) 00055 00056 #else 00057 00058 #define BXEXPORT 00059 #define BXLOCAL 00060 00061 #endif 00062 00063 #endif 00064