Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Sep 2015 08:38:52 -0700
From:      Kevin Oberman <rkoberman@gmail.com>
To:        "current@freebsd.org" <current@freebsd.org>
Subject:   Port compilation fails on HEAD. works on 9 and 10 STABLE
Message-ID:  <CAN6yY1tcmg8w4TX5icHPnvX_ZBT==hSJw2BMQX_Trp21wTPV0g@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN6yY1tcmg8w4TX5icHPnvX_ZBT==hSJw2BMQX_Trp21wTPV0g>