Allow compiling client-side with GCC (#2056)

* Allow compiling client-side with GCC

* Merge branch 'master' into nsubiron/gcc
This commit is contained in:
Néstor Subirón 2019-09-06 17:04:54 +02:00 committed by bernat
parent 7e7f989606
commit b45f7c5f95
5 changed files with 8 additions and 8 deletions

View File

@ -4,8 +4,8 @@ BINDIR=$(CURDIR)/bin
INSTALLDIR=$(CURDIR)/libcarla-install
TOOLCHAIN=$(CURDIR)/ToolChain.cmake
CC=/usr/bin/clang-7
CXX=/usr/bin/clang++-7
CC=/usr/bin/gcc-7
CXX=/usr/bin/g++-7
CXXFLAGS=-std=c++14 -pthread -fPIC -O3 -DNDEBUG -Werror -Wall -Wextra
define log

View File

@ -9,7 +9,7 @@
#if defined(_MSC_VER)
# define LIBCARLA_FORCEINLINE __forceinline
# define LIBCARLA_NOINLINE __declspec(noinline)
#elif defined(__clang__)
#elif defined(__clang__) || defined(__GNUC__)
# if defined(NDEBUG)
# define LIBCARLA_FORCEINLINE inline __attribute__((always_inline))
# else

View File

@ -48,12 +48,12 @@ namespace detail {
"exception thrown while trying to garbage collect Actor",
ptr->GetDisplayId(),
e.what());
throw; // calls terminate.
std::terminate();
} catch (...) {
log_critical(
"unknown exception thrown while trying to garbage collect an Actor :",
ptr->GetDisplayId());
throw; // calls terminate.
std::terminate();
}
}
}

View File

@ -55,6 +55,8 @@ namespace detail {
protected:
explicit ActorState(rpc::Actor description, EpisodeProxy episode);
const geom::BoundingBox &GetBoundingBox() const {
return _description.bounding_box;
}
@ -75,8 +77,6 @@ namespace detail {
friend class Simulator;
explicit ActorState(rpc::Actor description, EpisodeProxy episode);
rpc::Actor _description;
EpisodeProxy _episode;

View File

@ -65,7 +65,7 @@ namespace s11n {
}
void SetHorizontalAngle(float angle) {
_header[Index::HorizontalAngle] = reinterpret_cast<const uint32_t &>(angle);
std::memcpy(&_header[Index::HorizontalAngle], &angle, sizeof(uint32_t));
}
uint32_t GetChannelCount() const {