Port compilation fails on HEAD. works on 9 and 10 STABLE

From: Kevin Oberman <rkoberman_at_gmail.com>
Date: Wed, 23 Sep 2015 08:38:52 -0700
met/mediatomb fails to compile with clang++36. Works fine with gcc++ and
older versions of clang++.

/usr/local/bin/clang++36 -DHAVE_CONFIG_H -I. -I.. -I../tombupnp/upnp/inc
-I/usr/local/include -DLIBICONV_PLUG -I../src  -I../tombupnp/ixml/inc
-I../tombupnp/threadutil/inc  -I../tombupnp/upnp/inc  -I..
-I/usr/local/include    -I/usr/local/include
-I/usr/local/include/taglib          -I/usr/local/include
-D_THREAD_SAFE      -I/usr/local/include  -I/usr/local/include       -O2
-pipe -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing
-DLIBICONV_PLUG -MT libmediatomb_a-timer.o -MD -MP -MF
.deps/libmediatomb_a-timer.Tpo -c -o libmediatomb_a-timer.o `test -f
'../src/timer.cc' || echo './'`../src/timer.cc
../src/timer.cc:40:1: error: explicit specialization of 'mutex' after
      instantiation
SINGLETON_MUTEX(Timer, true);
^
../src/singleton.h:112:89: note: expanded from macro 'SINGLETON_MUTEX'
  ...recursive) template <> zmm::Ref<Mutex> Singleton<klass>::mutex =
zmm::Re...
                                                              ^
../src/timer.h:82:18: note: implicit instantiation first required here
        AUTOLOCK(mutex);
                 ^
../src/sync.h:40:66: note: expanded from macro 'AUTOLOCK'
#define AUTOLOCK(mutex) zmm::Ref<MutexAutolock> mutex_autolock = mutex->...
                                                                 ^
1 error generated.

The macro in question is:
#define SINGLETON_MUTEX(klass, recursive) template <> zmm::Ref<Mutex>
Singleton<klass>::mutex = zmm::Ref<Mutex>(new Mutex(recursive))
//template <class T> zmm::Ref<Mutex> Singleton<T>::mutex =
zmm::Ref<Mutex>(new Mutex());
template <class T> zmm::Ref<T> Singleton<T>::instance = nil;
template <class T> bool Singleton<T>::singletonActive = true;

Is this a problem with the code or the compiler? If it is the code, any
suggestions on fixing it? I have no clue about C++, but I'd really like to
get this working on HEAD.
--
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman_at_gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
Received on Wed Sep 23 2015 - 13:38:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:59 UTC