Jack2
1.9.8
|
00001 /* 00002 Copyright (C) 2010 Paul Davis 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU Lesser General Public License as published by 00006 the Free Software Foundation; either version 2.1 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU Lesser General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 */ 00019 00020 #ifndef __weakmacros_h__ 00021 #define __weakmacros_h__ 00022 00023 /************************************************************* 00024 * NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function 00025 * added to the JACK API after the 0.116.2 release. 00026 * 00027 * Functions that predate this release are marked with 00028 * JACK_WEAK_OPTIONAL_EXPORT which can be defined at compile 00029 * time in a variety of ways. The default definition is empty, 00030 * so that these symbols get normal linkage. If you wish to 00031 * use all JACK symbols with weak linkage, include 00032 * <jack/weakjack.h> before jack.h. 00033 *************************************************************/ 00034 00035 #ifdef __APPLE__ 00036 #define WEAK_ATTRIBUTE weak_import 00037 #else 00038 #define WEAK_ATTRIBUTE __weak__ 00039 #endif 00040 00041 #ifndef JACK_WEAK_EXPORT 00042 #ifdef __GNUC__ 00043 /* JACK_WEAK_EXPORT needs to be a macro which 00044 expands into a compiler directive. If non-null, the directive 00045 must tell the compiler to arrange for weak linkage of 00046 the symbol it used with. For this to work full may 00047 require linker arguments in the client as well. 00048 */ 00049 00050 #ifdef WIN32 00051 /* 00052 Not working with __declspec(dllexport) so normal linking 00053 Linking with JackWeakAPI.cpp will be the preferred way. 00054 */ 00055 #define JACK_WEAK_EXPORT 00056 #else 00057 #define JACK_WEAK_EXPORT __attribute__((WEAK_ATTRIBUTE)) 00058 #endif 00059 00060 #else 00061 /* Add other things here for non-gcc platforms */ 00062 00063 #ifdef WIN32 00064 #define JACK_WEAK_EXPORT 00065 #endif 00066 00067 #endif 00068 #endif 00069 00070 #ifndef JACK_OPTIONAL_WEAK_EXPORT 00071 #define JACK_OPTIONAL_WEAK_EXPORT 00072 #endif 00073 00074 #ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT 00075 #ifdef __GNUC__ 00076 #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT __attribute__((__deprecated__)) 00077 #else 00078 /* Add other things here for non-gcc platforms */ 00079 00080 #ifdef WIN32 00081 #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT 00082 #endif 00083 00084 #endif /* __GNUC__ */ 00085 #endif 00086 00087 #endif /* __weakmacros_h__ */ 00088