clangd broke because it can't look through symlinks. compile_commands manipulation does not fix it, clangd configuration does not fix it, a vfs overlay does not fix it, and while a combination of those can fix it with a bind mount in place that's just too cursed to even consider clangd bug: https://github.com/llvm/llvm-project/issues/116877 Change-Id: I8e3e8489548eb3a7aa65ac9d12a5ec8abf814aec
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#pragma once
|
|
/**
|
|
* @file
|
|
*
|
|
* Template implementations (as opposed to mere declarations).
|
|
*
|
|
* This file is an exmample of the "impl.hh" pattern. See the
|
|
* contributing guide.
|
|
*/
|
|
|
|
#include "lix/libstore/common-protocol.hh"
|
|
#include "lix/libstore/length-prefixed-protocol-helper.hh"
|
|
|
|
namespace nix {
|
|
|
|
/* protocol-agnostic templates */
|
|
|
|
#define COMMON_USE_LENGTH_PREFIX_SERIALISER(TEMPLATE, T) \
|
|
TEMPLATE T CommonProto::Serialise< T >::read(const Store & store, CommonProto::ReadConn conn) \
|
|
{ \
|
|
return LengthPrefixedProtoHelper<CommonProto, T >::read(store, conn); \
|
|
} \
|
|
/* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
|
|
TEMPLATE [[nodiscard]] WireFormatGenerator CommonProto::Serialise< T >::write(const Store & store, CommonProto::WriteConn conn, const T & t) \
|
|
{ \
|
|
return LengthPrefixedProtoHelper<CommonProto, T >::write(store, conn, t); \
|
|
}
|
|
|
|
COMMON_USE_LENGTH_PREFIX_SERIALISER(template<typename T>, std::vector<T>)
|
|
COMMON_USE_LENGTH_PREFIX_SERIALISER(template<typename T>, std::set<T>)
|
|
COMMON_USE_LENGTH_PREFIX_SERIALISER(template<typename... Ts>, std::tuple<Ts...>)
|
|
|
|
#define COMMA_ ,
|
|
COMMON_USE_LENGTH_PREFIX_SERIALISER(
|
|
template<typename K COMMA_ typename V>,
|
|
std::map<K COMMA_ V>)
|
|
#undef COMMA_
|
|
|
|
|
|
/* protocol-specific templates */
|
|
|
|
}
|