mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00

This largely copies over Spicy's `.clang-format` configuration file. The one place where we deviate is header include order since Zeek depends on headers being included in a certain order.
32 lines
661 B
C++
32 lines
661 B
C++
// See the file "COPYING" in the main distribution directory for copyright.
|
|
|
|
#pragma once
|
|
|
|
#include "zeek/zeek-config.h"
|
|
|
|
#include "zeek/IntrusivePtr.h"
|
|
|
|
namespace zeek {
|
|
|
|
class Val;
|
|
using ValPtr = IntrusivePtr<Val>;
|
|
|
|
namespace detail {
|
|
|
|
/**
|
|
* A simple wrapper class to use for the return value of BIFs so that
|
|
* they may return either a Val* or IntrusivePtr<Val> (the former could
|
|
* potentially be deprecated).
|
|
*/
|
|
class BifReturnVal {
|
|
public:
|
|
template<typename T>
|
|
BifReturnVal(IntrusivePtr<T> v) noexcept : rval(AdoptRef{}, v.release()) {}
|
|
|
|
BifReturnVal(std::nullptr_t) noexcept;
|
|
|
|
ValPtr rval;
|
|
};
|
|
|
|
} // namespace detail
|
|
} // namespace zeek
|