diff --git a/common/JackDebugClient.cpp b/common/JackDebugClient.cpp index df263779..6a90fcdc 100644 --- a/common/JackDebugClient.cpp +++ b/common/JackDebugClient.cpp @@ -121,7 +121,7 @@ void JackDebugClient::CheckClient(const char* function_name) const *fStream << "!!! ERROR !!! : Accessing a client '" << fClientName << "' already closed " << "from " << function_name << endl; *fStream << "This is likely to cause crash !'" << endl; #ifdef __APPLE__ - Debugger(); + // Debugger(); #endif } } diff --git a/common/jack/jack.h b/common/jack/jack.h index f1fe4d7b..96800dcd 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -46,31 +46,7 @@ extern "C" * before jack.h. *************************************************************/ -#ifndef JACK_WEAK_EXPORT -#ifdef __GNUC__ - /* JACK_WEAK_EXPORT needs to be a macro which - expands into a compiler directive. If non-null, the directive - must tell the compiler to arrange for weak linkage of - the symbol it used with. For this to work full may - require linker arguments in the client as well. - */ -#define JACK_WEAK_EXPORT __attribute__((weak)) -#else - /* Add other things here for non-gcc platforms */ -#endif -#endif - -#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 */ -#endif /* __GNUC__ */ -#endif +#include /** * Call this function to get version of the JACK, in form of several numbers diff --git a/common/jack/midiport.h b/common/jack/midiport.h index da0b940d..fd620b8d 100644 --- a/common/jack/midiport.h +++ b/common/jack/midiport.h @@ -27,7 +27,7 @@ extern "C" { #include #include - +#include /** Type for raw event data contained in @ref jack_midi_event_t. */ typedef unsigned char jack_midi_data_t; @@ -53,7 +53,7 @@ typedef struct _jack_midi_event * @return number of events inside @a port_buffer */ jack_nframes_t -jack_midi_get_event_count(void* port_buffer); +jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; /** Get a MIDI event from an event port buffer. @@ -70,7 +70,7 @@ jack_midi_get_event_count(void* port_buffer); int jack_midi_event_get(jack_midi_event_t *event, void *port_buffer, - jack_nframes_t event_index); + jack_nframes_t event_index) JACK_OPTIONAL_WEAK_EXPORT; /** Clear an event buffer. @@ -82,7 +82,7 @@ jack_midi_event_get(jack_midi_event_t *event, * @param port_buffer Port buffer to clear (must be an output port buffer). */ void -jack_midi_clear_buffer(void *port_buffer); +jack_midi_clear_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT; /** Get the size of the largest event that can be stored by the port. @@ -93,7 +93,7 @@ jack_midi_clear_buffer(void *port_buffer); * @param port_buffer Port buffer to check size of. */ size_t -jack_midi_max_event_size(void* port_buffer); +jack_midi_max_event_size(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; /** Allocate space for an event to be written to an event port buffer. @@ -112,9 +112,9 @@ jack_midi_max_event_size(void* port_buffer); * NULL on error (ie not enough space). */ jack_midi_data_t* -jack_midi_event_reserve(void *port_buffer, +jack_midi_event_reserve(void *port_buffer, jack_nframes_t time, - size_t data_size); + size_t data_size) JACK_OPTIONAL_WEAK_EXPORT; /** Write an event into an event port buffer. @@ -130,10 +130,10 @@ jack_midi_event_reserve(void *port_buffer, * @return 0 on success, ENOBUFS if there's not enough space in buffer for event. */ int -jack_midi_event_write(void *port_buffer, - jack_nframes_t time, +jack_midi_event_write(void *port_buffer, + jack_nframes_t time, const jack_midi_data_t *data, - size_t data_size); + size_t data_size) JACK_OPTIONAL_WEAK_EXPORT; /** Get the number of events that could not be written to @a port_buffer. @@ -145,7 +145,7 @@ jack_midi_event_write(void *port_buffer, * @returns Number of events that could not be written to @a port_buffer. */ jack_nframes_t -jack_midi_get_lost_event_count(void *port_buffer); +jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT; /*@}*/ diff --git a/common/jack/thread.h b/common/jack/thread.h index 48adf084..5d002afa 100644 --- a/common/jack/thread.h +++ b/common/jack/thread.h @@ -26,6 +26,7 @@ extern "C" #endif #include +#include /** @file thread.h * @@ -45,7 +46,7 @@ extern "C" * Otherwise returns -1. */ -int jack_client_real_time_priority (jack_client_t*); +int jack_client_real_time_priority (jack_client_t*) JACK_OPTIONAL_WEAK_EXPORT; /** * @returns if JACK is running with realtime scheduling, this returns @@ -53,7 +54,7 @@ int jack_client_real_time_priority (jack_client_t*); * is subject to realtime scheduling. Otherwise returns -1. */ -int jack_client_max_real_time_priority (jack_client_t*); +int jack_client_max_real_time_priority (jack_client_t*) JACK_OPTIONAL_WEAK_EXPORT; /** * Attempt to enable realtime scheduling for a thread. On some @@ -65,7 +66,7 @@ int jack_client_max_real_time_priority (jack_client_t*); * @returns 0, if successful; EPERM, if the calling process lacks * required realtime privileges; otherwise some other error number. */ -int jack_acquire_real_time_scheduling (pthread_t thread, int priority); +int jack_acquire_real_time_scheduling (pthread_t thread, int priority) JACK_OPTIONAL_WEAK_EXPORT; /** * Create a thread for JACK or one of its clients. The thread is @@ -88,7 +89,7 @@ int jack_client_create_thread (jack_client_t* client, int priority, int realtime, /* boolean */ void *(*start_routine)(void*), - void *arg); + void *arg) JACK_OPTIONAL_WEAK_EXPORT; /** * Drop realtime scheduling for a thread. @@ -97,7 +98,7 @@ int jack_client_create_thread (jack_client_t* client, * * @returns 0, if successful; otherwise an error number. */ -int jack_drop_real_time_scheduling (pthread_t thread); +int jack_drop_real_time_scheduling (pthread_t thread) JACK_OPTIONAL_WEAK_EXPORT; /** * Stop the thread, waiting for the thread handler to terminate. @@ -106,7 +107,7 @@ int jack_drop_real_time_scheduling (pthread_t thread); * * @returns 0, if successful; otherwise an error number. */ -int jack_client_stop_thread(jack_client_t* client, pthread_t thread); +int jack_client_stop_thread(jack_client_t* client, pthread_t thread) JACK_OPTIONAL_WEAK_EXPORT; /** * Cancel the thread then waits for the thread handler to terminate. @@ -115,7 +116,7 @@ int jack_client_stop_thread(jack_client_t* client, pthread_t thread); * * @returns 0, if successful; otherwise an error number. */ - int jack_client_kill_thread(jack_client_t* client, pthread_t thread); + int jack_client_kill_thread(jack_client_t* client, pthread_t thread) JACK_OPTIONAL_WEAK_EXPORT; #ifndef WIN32 @@ -142,7 +143,7 @@ int jack_client_stop_thread(jack_client_t* client, pthread_t thread); * @param creator a function that creates a new thread * */ -void jack_set_thread_creator (jack_thread_creator_t creator); +void jack_set_thread_creator (jack_thread_creator_t creator) JACK_OPTIONAL_WEAK_EXPORT; #endif diff --git a/common/jack/transport.h b/common/jack/transport.h index 67bcaa2a..e8ba8cbb 100644 --- a/common/jack/transport.h +++ b/common/jack/transport.h @@ -26,6 +26,7 @@ extern "C" { #endif #include +#include /** * @defgroup TransportControl Transport and Timebase control @@ -48,7 +49,7 @@ extern "C" { * * @return 0 on success, otherwise a non-zero error code. */ -int jack_release_timebase (jack_client_t *client); +int jack_release_timebase (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** * Register (or unregister) as a slow-sync client, one that cannot @@ -72,7 +73,7 @@ int jack_release_timebase (jack_client_t *client); */ int jack_set_sync_callback (jack_client_t *client, JackSyncCallback sync_callback, - void *arg); + void *arg) JACK_OPTIONAL_WEAK_EXPORT; /** * Set the timeout value for slow-sync clients. @@ -92,7 +93,7 @@ int jack_set_sync_callback (jack_client_t *client, * @return 0 on success, otherwise a non-zero error code. */ int jack_set_sync_timeout (jack_client_t *client, - jack_time_t timeout); + jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT; /** * Register as timebase master for the JACK subsystem. @@ -122,7 +123,7 @@ int jack_set_sync_timeout (jack_client_t *client, int jack_set_timebase_callback (jack_client_t *client, int conditional, JackTimebaseCallback timebase_callback, - void *arg); + void *arg) JACK_OPTIONAL_WEAK_EXPORT; /** * Reposition the transport to a new frame number. @@ -141,7 +142,7 @@ int jack_set_timebase_callback (jack_client_t *client, * @return 0 if valid request, non-zero otherwise. */ int jack_transport_locate (jack_client_t *client, - jack_nframes_t frame); + jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT; /** * Query the current transport state and position. @@ -159,7 +160,7 @@ int jack_transport_locate (jack_client_t *client, * @return Current transport state. */ jack_transport_state_t jack_transport_query (const jack_client_t *client, - jack_position_t *pos); + jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT; /** * Return an estimate of the current transport frame, @@ -168,7 +169,7 @@ jack_transport_state_t jack_transport_query (const jack_client_t *client, * * @param client the JACK client structure */ -jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client); +jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** * Request a new transport position. @@ -187,7 +188,7 @@ jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client); * @return 0 if valid request, EINVAL if position structure rejected. */ int jack_transport_reposition (jack_client_t *client, - jack_position_t *pos); + jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT; /** * Start the JACK transport rolling. @@ -200,7 +201,7 @@ int jack_transport_reposition (jack_client_t *client, * * @param client the JACK client structure. */ -void jack_transport_start (jack_client_t *client); +void jack_transport_start (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** * Stop the JACK transport. @@ -210,7 +211,7 @@ void jack_transport_start (jack_client_t *client); * * @param client the JACK client structure. */ -void jack_transport_stop (jack_client_t *client); +void jack_transport_stop (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** * Gets the current transport info structure (deprecated). @@ -225,7 +226,7 @@ void jack_transport_stop (jack_client_t *client); * @pre Must be called from the process thread. */ void jack_get_transport_info (jack_client_t *client, - jack_transport_info_t *tinfo); + jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_EXPORT; /** * Set the transport info structure (deprecated). @@ -235,7 +236,7 @@ void jack_get_transport_info (jack_client_t *client, * a ::JackTimebaseCallback. */ void jack_set_transport_info (jack_client_t *client, - jack_transport_info_t *tinfo); + jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_EXPORT; /*@}*/ diff --git a/common/jack/weakmacros.h b/common/jack/weakmacros.h new file mode 100644 index 00000000..3db19d3f --- /dev/null +++ b/common/jack/weakmacros.h @@ -0,0 +1,61 @@ +/* + Copyright (C) 2010 Paul Davis + + 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. + + 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. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#ifndef __weakmacros_h__ +#define __weakmacros_h__ + +/************************************************************* + * NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function + * added to the JACK API after the 0.116.2 release. + * + * Functions that predate this release are marked with + * 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 + * use all JACK symbols with weak linkage, include + * before jack.h. + *************************************************************/ + +#ifndef JACK_WEAK_EXPORT +#ifdef __GNUC__ +/* JACK_WEAK_EXPORT needs to be a macro which + expands into a compiler directive. If non-null, the directive + must tell the compiler to arrange for weak linkage of + the symbol it used with. For this to work full may + require linker arguments in the client as well. +*/ +#define JACK_WEAK_EXPORT __attribute__((weak)) +#else +/* Add other things here for non-gcc platforms */ +#endif +#endif + +#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 */ +#endif /* __GNUC__ */ +#endif + +#endif /* __weakmacros_h__ */