Skip to content

Commit

Permalink
workarounds for duplicate symbols on Linux with o.route, o.var, and o…
Browse files Browse the repository at this point in the history
….pack families
  • Loading branch information
John MacCallum committed Nov 29, 2021
1 parent b714ece commit a7f634b
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 2 deletions.
21 changes: 21 additions & 0 deletions src/o.pack/o.pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,27 @@ VERSION 1.1: renamed o.pack (from o.build)

#include "o.h"

/*
Workaround for duplicate symbol problem on Linux.
I regret what I've done...
*/
#ifdef PAK
#define opack_anything opak_anything
#define opack_fullPacket opak_fullPacket
#define opack_assist opak_assist
#define opack_int opak_int
#define opack_bang opak_bang
#define opack_list opak_list
#define opack_doAnything opak_doAnything
#define opack_new opak_new
#define opack_doc opak_doc
#define opack_outputBundle opak_outputBundle
#define opack_float opak_float
#define opack_set opak_set
#define opack_free opak_free
#define opack_symbol opak_symbol
#endif

//#define MAX_NUM_ARGS 64

typedef struct _opack{
Expand Down
34 changes: 32 additions & 2 deletions src/o.route/o.route.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,37 @@ VERSION 0.1: Addresses to match can now have patterns

#define OMAX_DOC_INLETS_DESC (char *[]){"OSC packet"}


/*
Workaround for duplicate symbol problem on Linux.
I regret what I've done...
*/
#if defined(SELECT)
#define oroute_anything oselect_anything
#define oroute_free oselect_free
#define oroute_assist oselect_assist
#define oroute_fullPacket oselect_fullPacket
#define oroute_atomizeBundle oselect_atomizeBundle
#define oroute_makeSchema oselect_makeSchema
#define oroute_dispatch_rset oselect_dispatch_rset
#define oroute_makeUniqueSelectors oselect_makeUniqueSelectors
#define oroute_doSet oselect_doSet
#define oroute_new oselect_new
#define oroute_doc oselect_doc
#define oroute_set oselect_set
#elif defined(ATOMIZE)
#define oroute_anything oatomize_anything
#define oroute_free oatomize_free
#define oroute_assist oatomize_assist
#define oroute_fullPacket oatomize_fullPacket
#define oroute_atomizeBundle oatomize_atomizeBundle
#define oroute_makeSchema oatomize_makeSchema
#define oroute_dispatch_rset oatomize_dispatch_rset
#define oroute_makeUniqueSelectors oatomize_makeUniqueSelectors
#define oroute_doSet oatomize_doSet
#define oroute_new oatomize_new
#define oroute_doc oatomize_doc
#define oroute_set oatomize_set
#endif


#include "odot_version.h"
Expand Down Expand Up @@ -586,7 +616,7 @@ int setup_o0x2eroute(void)
t_symbol *name = gensym("o.route");
#endif
t_class *c = class_new(name, (t_newmethod)oroute_new, (t_method)oroute_free, sizeof(t_oroute), 0L, A_GIMME, 0);

class_addmethod(c, (t_method)odot_version, gensym("version"), 0);
class_addmethod(c, (t_method)oroute_set, gensym("set"), A_GIMME, 0);
class_addmethod(c, (t_method)oroute_fullPacket, gensym("FullPacket"), A_GIMME, 0);
Expand Down
42 changes: 42 additions & 0 deletions src/o.var/o.var.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,48 @@

#include "o.h"

/*
Workaround for duplicate symbol problem on Linux.
I regret what I've done...
*/
#if defined(ODOT_UNION)
#define ovar_anything ounion_anything
#define ovar_doc ounion_doc
#define ovar_assist ounion_assist
#define ovar_free ounion_free
#define ovar_bang ounion_bang
#define ovar_fullPacket ounion_fullPacket
#define ovar_clear ounion_clear
#define ovar_fullPacket_in1 ounion_fullPacket_in1
#define ovar_doAnything ounion_doAnything
#define ovar_new ounion_new
#define ovar_doFullPacket ounion_doFullPacket
#elif defined(ODOT_DIFFERENCE)
#define ovar_anything odifference_anything
#define ovar_doc odifference_doc
#define ovar_assist odifference_assist
#define ovar_free odifference_free
#define ovar_bang odifference_bang
#define ovar_fullPacket odifference_fullPacket
#define ovar_clear odifference_clear
#define ovar_fullPacket_in1 odifference_fullPacket_in1
#define ovar_doAnything odifference_doAnything
#define ovar_new odifference_new
#define ovar_doFullPacket odifference_doFullPacket
#elif defined(ODOT_INTERSECTION)
#define ovar_anything ointersection_anything
#define ovar_doc ointersection_doc
#define ovar_assist ointersection_assist
#define ovar_free ointersection_free
#define ovar_bang ointersection_bang
#define ovar_fullPacket ointersection_fullPacket
#define ovar_clear ointersection_clear
#define ovar_fullPacket_in1 ointersection_fullPacket_in1
#define ovar_doAnything ointersection_doAnything
#define ovar_new ointersection_new
#define ovar_doFullPacket ointersection_doFullPacket
#endif

typedef struct _ovar{
t_object ob;
void *outlet;
Expand Down

0 comments on commit a7f634b

Please sign in to comment.