Skip to content

Commit

Permalink
Allow compiling client-side with GCC (carla-simulator#2056)
Browse files Browse the repository at this point in the history
* Allow compiling client-side with GCC

* Merge branch 'master' into nsubiron/gcc
  • Loading branch information
nsubiron authored and bernatx committed Sep 6, 2019
1 parent 7e7f989 commit b45f7c5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Examples/CppClient/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LibCarla/source/carla/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions LibCarla/source/carla/client/detail/ActorFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions LibCarla/source/carla/client/detail/ActorState.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ namespace detail {

protected:

explicit ActorState(rpc::Actor description, EpisodeProxy episode);

const geom::BoundingBox &GetBoundingBox() const {
return _description.bounding_box;
}
Expand All @@ -75,8 +77,6 @@ namespace detail {

friend class Simulator;

explicit ActorState(rpc::Actor description, EpisodeProxy episode);

rpc::Actor _description;

EpisodeProxy _episode;
Expand Down
2 changes: 1 addition & 1 deletion LibCarla/source/carla/sensor/s11n/LidarMeasurement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b45f7c5

Please sign in to comment.