jack-headers/weakmacros.h

98 lines
2.7 KiB
C
Raw Normal View History

2012-02-02 19:16:32 +02:00
/*
Copyright (C) 2010 Paul Davis
2022-08-22 21:15:02 +03:00
2012-02-02 19:16:32 +02:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
2022-08-22 21:15:02 +03:00
2012-02-02 19:16:32 +02:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
2022-08-22 21:15:02 +03:00
2012-02-02 19:16:32 +02:00
You should have received a copy of the GNU Lesser General Public License
2022-08-22 21:15:02 +03:00
along with this program; if not, write to the Free Software
2012-02-02 19:16:32 +02:00
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2022-09-06 20:48:07 +03:00
2012-02-02 19:16:32 +02:00
*/
2022-09-06 20:48:07 +03:00
#ifndef __weakmacros_h__
#define __weakmacros_h__
2012-02-02 19:16:32 +02:00
/*************************************************************
* NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function
* added to the JACK API after the 0.116.2 release.
2022-08-22 21:15:02 +03:00
*
* Functions that predate this release are marked with
2012-02-02 19:16:32 +02:00
* JACK_WEAK_OPTIONAL_EXPORT which can be defined at compile
* time in a variety of ways. The default definition is empty,
* so that these symbols get normal linkage. If you wish to
2022-08-22 21:15:02 +03:00
* use all JACK symbols with weak linkage, include
2012-02-02 19:16:32 +02:00
* <jack/weakjack.h> before jack.h.
*************************************************************/
#ifdef __APPLE__
#define WEAK_ATTRIBUTE weak_import
#else
#define WEAK_ATTRIBUTE __weak__
#endif
#ifndef JACK_WEAK_EXPORT
#ifdef __GNUC__
/* JACK_WEAK_EXPORT needs to be a macro which
2022-08-22 21:15:02 +03:00
expands into a compiler directive. If non-null, the directive
must tell the compiler to arrange for weak linkage of
2012-02-02 19:16:32 +02:00
the symbol it used with. For this to work full may
require linker arguments in the client as well.
*/
2022-09-06 20:48:07 +03:00
#ifdef _WIN32
/*
Not working with __declspec(dllexport) so normal linking
Linking with JackWeakAPI.cpp will be the preferred way.
*/
#define JACK_WEAK_EXPORT
#else
#define JACK_WEAK_EXPORT __attribute__((WEAK_ATTRIBUTE))
#endif
2012-02-02 19:16:32 +02:00
#else
/* Add other things here for non-gcc platforms */
2022-09-06 20:48:07 +03:00
#ifdef _WIN32
#define JACK_WEAK_EXPORT
#endif
2012-02-02 19:16:32 +02:00
#endif
#endif
2022-09-06 20:48:07 +03:00
#ifndef JACK_WEAK_EXPORT
#define JACK_WEAK_EXPORT
#endif
2012-02-02 19:16:32 +02:00
#ifndef JACK_OPTIONAL_WEAK_EXPORT
#define JACK_OPTIONAL_WEAK_EXPORT
#endif
#ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
#ifdef __GNUC__
#define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT __attribute__((__deprecated__))
#else
/* Add other things here for non-gcc platforms */
2022-09-06 20:48:07 +03:00
#ifdef _WIN32
#define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
#endif
2012-02-02 19:16:32 +02:00
#endif /* __GNUC__ */
2022-09-06 20:48:07 +03:00
#ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
#define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
#endif
2012-02-02 19:16:32 +02:00
#endif
2022-09-06 20:48:07 +03:00
#endif /* __weakmacros_h__ */