om-synth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Om-synth] He's baaaaack


From: Dave Robillard
Subject: Re: [Om-synth] He's baaaaack
Date: Mon, 05 Dec 2005 19:51:01 -0500

On Fri, 2005-02-12 at 21:13 +0100, address@hidden wrote:
> Le Vendredi 02 Décembre 2005 07:27, Dave Robillard a écrit :
> > I'm back in internetland now, so I can start working on Ommey things
> > again.  I remember a bunch of things needing doing after the big
> > refactor, but not exactly what.
> 
> 
> It seems the current cvs doesn't compile (at least on my computer using gcc 
> 3.3.6), because of this line in bridgenode.cpp :
> 
> m_driver_port = om->driver<T>()->create_port(m_external_port);
> 
> As far as I can tell, you can't specify which function driver() you want this 
> way. Unfortunately, this won't work either:
> 
> m_driver_port = om->driver()->create_port(m_external_port);
> 
> because the only way the compiler would know which function to use would be 
> to 
> look at the return type (Driver<T>*), but C++ compilers can't do that.
> A simple workaround is to add an unused parameter to the function driver() so 
> that the compiler knows which function to instantiate. Here's the 
> coresponding diff:
> 
> Index: src/engine/BridgeNode.cpp
> ===================================================================
> diff -r1.6 BridgeNode.cpp
> 63c63
> <               m_driver_port = om->driver<T>()->create_port(m_external_port);
> ---
> >               m_driver_port = 
> >                   om->driver((T*)NULL)->create_port(m_external_port); 
> 
> ===================================================================
> diff -r1.40 OmApp.cpp
> 116c116
> < Driver<MidiMessage>* OmApp::driver<MidiMessage>() { return m_midi_driver; }
> ---
> > Driver<MidiMessage>* OmApp::driver<MidiMessage>(MidiMessage*) 
> >     { return m_midi_driver; } 
> 118c118
> < Driver<sample>* OmApp::driver<sample>() { return m_audio_driver; }
> ---
> > Driver<sample>* OmApp::driver<sample>(sample*) { return m_audio_driver; }
> 
> 
> Not very nice, but it works ;)

The current version is correct, it's GCC 3.3 that's wrong.

Can anyone figure out how to fix this for useless ancient gcc 3.3
without doing this parameter thing?  Kinda defeats the purpose of
templates.  I can't possibly see GCC 3.3 not supporting template
methods?!

I might just make it all runtime anyway, it'd probably mesh with future
plugin specs better.

-DR-






reply via email to

[Prev in Thread] Current Thread [Next in Thread]