2 Copyright (C) 2010 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __weakmacros_h__
21 #define __weakmacros_h__
23 /*************************************************************
24 * NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function
25 * added to the JACK API after the 0.116.2 release.
27 * Functions that predate this release are marked with
28 * JACK_WEAK_OPTIONAL_EXPORT which can be defined at compile
29 * time in a variety of ways. The default definition is empty,
30 * so that these symbols get normal linkage. If you wish to
31 * use all JACK symbols with weak linkage, include
32 * <jack/weakjack.h> before jack.h.
33 *************************************************************/
36 #define WEAK_ATTRIBUTE weak_import
38 #define WEAK_ATTRIBUTE __weak__
41 #ifndef JACK_WEAK_EXPORT
43 /* JACK_WEAK_EXPORT needs to be a macro which
44 expands into a compiler directive. If non-null, the directive
45 must tell the compiler to arrange for weak linkage of
46 the symbol it used with. For this to work full may
47 require linker arguments in the client as well.
52 Not working with __declspec(dllexport) so normal linking
53 Linking with JackWeakAPI.cpp will be the preferred way.
55 #define JACK_WEAK_EXPORT
57 #define JACK_WEAK_EXPORT __attribute__((WEAK_ATTRIBUTE))
61 /* Add other things here for non-gcc platforms */
64 #define JACK_WEAK_EXPORT
70 #ifndef JACK_WEAK_EXPORT
71 #define JACK_WEAK_EXPORT
74 #ifndef JACK_OPTIONAL_WEAK_EXPORT
75 #define JACK_OPTIONAL_WEAK_EXPORT
78 #ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
80 #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT __attribute__((__deprecated__))
82 /* Add other things here for non-gcc platforms */
85 #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
90 #ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
91 #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
96 #endif /* __weakmacros_h__ */