Update jack2 pdf link to archive.org
[jackdbus.git] / common / jack / weakmacros.h
blob944fddb9b96f4a66563fe59f9a77b7e265062239
1 /*
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 *************************************************************/
35 #ifdef __APPLE__
36 #define WEAK_ATTRIBUTE weak_import
37 #else
38 #define WEAK_ATTRIBUTE __weak__
39 #endif
41 #ifndef JACK_WEAK_EXPORT
42 #ifdef __GNUC__
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.
50 #ifdef _WIN32
52 Not working with __declspec(dllexport) so normal linking
53 Linking with JackWeakAPI.cpp will be the preferred way.
55 #define JACK_WEAK_EXPORT
56 #else
57 #define JACK_WEAK_EXPORT __attribute__((WEAK_ATTRIBUTE))
58 #endif
60 #else
61 /* Add other things here for non-gcc platforms */
63 #ifdef _WIN32
64 #define JACK_WEAK_EXPORT
65 #endif
67 #endif
68 #endif
70 #ifndef JACK_WEAK_EXPORT
71 #define JACK_WEAK_EXPORT
72 #endif
74 #ifndef JACK_OPTIONAL_WEAK_EXPORT
75 #define JACK_OPTIONAL_WEAK_EXPORT
76 #endif
78 #ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
79 #ifdef __GNUC__
80 #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT __attribute__((__deprecated__))
81 #else
82 /* Add other things here for non-gcc platforms */
84 #ifdef _WIN32
85 #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
86 #endif
88 #endif /* __GNUC__ */
90 #ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
91 #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
92 #endif
94 #endif
96 #endif /* __weakmacros_h__ */