Avoid inlining logging functions
This commit is contained in:
parent
6cc90cea77
commit
f9b2b10b02
|
@ -6,6 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "carla/Platform.h"
|
||||
|
||||
#define LIBCARLA_LOG_LEVEL_DEBUG 10
|
||||
#define LIBCARLA_LOG_LEVEL_INFO 20
|
||||
#define LIBCARLA_LOG_LEVEL_WARNING 30
|
||||
|
@ -46,6 +48,7 @@ namespace logging {
|
|||
|
||||
// https://stackoverflow.com/a/27375675
|
||||
template <typename Arg, typename ... Args>
|
||||
LIBCARLA_NOINLINE
|
||||
static void write_to_stream(std::ostream &out, Arg &&arg, Args && ... args) {
|
||||
out << std::boolalpha << std::forward<Arg>(arg);
|
||||
using expander = int[];
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
|
||||
// de Barcelona (UAB).
|
||||
//
|
||||
// This work is licensed under the terms of the MIT license.
|
||||
// For a copy, see <https://opensource.org/licenses/MIT>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define LIBCARLA_FORCEINLINE __forceinline
|
||||
# define LIBCARLA_NOINLINE __declspec(noinline)
|
||||
#elif defined(__clang__)
|
||||
# if defined(NDEBUG)
|
||||
# define LIBCARLA_FORCEINLINE inline __attribute__((always_inline))
|
||||
# else
|
||||
# define LIBCARLA_FORCEINLINE inline
|
||||
# endif // NDEBUG
|
||||
# define LIBCARLA_NOINLINE __attribute__((noinline))
|
||||
#else
|
||||
# warning Compiler not supported.
|
||||
# define LIBCARLA_NOINLINE
|
||||
#endif
|
Loading…
Reference in New Issue