sigrokproject / pulseview

Read-only mirror of the official repo at git://sigrok.org/pulseview. Pull requests welcome. Please file bugreports at sigrok.org/bugzilla.
http://sigrok.org/wiki/PulseView
GNU General Public License v3.0
487 stars 157 forks source link

Fix broken build due to C++ template behind C linkage #39

Closed StefanBruens closed 3 years ago

StefanBruens commented 3 years ago

glib/gatomic.h since 2.68 includes type_traits, which causes a compilation error: In file included from /usr/include/glib-2.0/glib/gatomic.h:31, from /usr/include/glib-2.0/glib/gthread.h:32, from /usr/include/glib-2.0/glib/gasyncqueue.h:32, from /usr/include/glib-2.0/glib.h:32, from /usr/include/libsigrokdecode/libsigrokdecode.h:25, from /home/abuild/rpmbuild/BUILD/pulseview-0.4.2/pv/data/decode/annotation.cpp:21: /usr/include/c++/10/type_traits:2308:3: error: template with C linkage 2308 | template<typename _CTp, typename _Rp>

As libsigrokdecode.h declares extern C linkage itself where necessary, remove it from pulseviews include statements from the last two occasions.

newydave commented 3 years ago

Can confirm that the proposed fix works for me with Gentoo, last compile worked fine.

Relevant versions: sh bash 5.1_p8 ld GNU ld (Gentoo 2.35.2 p1) 2.35.2 app-shells/bash: 5.1_p8::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.32.1::gentoo dev-lang/python: 2.7.18_p10::gentoo, 3.8.10_p2::gentoo, 3.9.5_p2::gentoo dev-lang/rust: 1.51.0-r2::gentoo dev-util/cmake: 3.18.5::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1-r1::gentoo sys-apps/sandbox: 2.24::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.16.3-r1::gentoo sys-devel/binutils: 2.35.2::gentoo sys-devel/gcc: 8.4.0-r2::gentoo, 10.3.0::gentoo sys-devel/gcc-config: 2.4::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.33::gentoo

abraxa commented 3 years ago

Merged as ed643f0b4ac587204a5243451cda181ee1405d62, thank you! Sorry it took so long..