Commit 55826685 authored by Kenton Varda's avatar Kenton Varda

CAPNPROTO_ -> CAPNP_

parent f1b07de7
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CAPNPROTO_PRIVATE #define CAPNP_PRIVATE
#include "arena.h" #include "arena.h"
#include "message.h" #include "message.h"
#include <kj/debug.h> #include <kj/debug.h>
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_ARENA_H_ #ifndef CAPNP_ARENA_H_
#define CAPNPROTO_ARENA_H_ #define CAPNP_ARENA_H_
#ifndef CAPNPROTO_PRIVATE #ifndef CAPNP_PRIVATE
#error "This header is only meant to be included by Cap'n Proto's own source code." #error "This header is only meant to be included by Cap'n Proto's own source code."
#endif #endif
...@@ -298,4 +298,4 @@ inline void SegmentBuilder::reset() { ...@@ -298,4 +298,4 @@ inline void SegmentBuilder::reset() {
} // namespace internal } // namespace internal
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_ARENA_H_ #endif // CAPNP_ARENA_H_
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_BENCHMARK_CAPNPROTO_COMMON_H_ #ifndef CAPNP_BENCHMARK_CAPNP_COMMON_H_
#define CAPNPROTO_BENCHMARK_CAPNPROTO_COMMON_H_ #define CAPNP_BENCHMARK_CAPNP_COMMON_H_
#include "common.h" #include "common.h"
#include <capnp/serialize.h> #include <capnp/serialize.h>
...@@ -418,4 +418,4 @@ struct BenchmarkTypes { ...@@ -418,4 +418,4 @@ struct BenchmarkTypes {
} // namespace benchmark } // namespace benchmark
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_BENCHMARK_CAPNPROTO_COMMON_H_ #endif // CAPNP_BENCHMARK_CAPNP_COMMON_H_
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_BENCHMARK_COMMON_H_ #ifndef CAPNP_BENCHMARK_COMMON_H_
#define CAPNPROTO_BENCHMARK_COMMON_H_ #define CAPNP_BENCHMARK_COMMON_H_
#include <unistd.h> #include <unistd.h>
#include <limits> #include <limits>
...@@ -282,4 +282,4 @@ int benchmarkMain(int argc, char* argv[]) { ...@@ -282,4 +282,4 @@ int benchmarkMain(int argc, char* argv[]) {
} // namespace capnp } // namespace capnp
} // namespace benchmark } // namespace benchmark
#endif // CAPNPROTO_BENCHMARK_COMMON_H_ #endif // CAPNP_BENCHMARK_COMMON_H_
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_BLOB_H_ #ifndef CAPNP_BLOB_H_
#define CAPNPROTO_BLOB_H_ #define CAPNP_BLOB_H_
#include <kj/common.h> #include <kj/common.h>
#include <kj/string.h> #include <kj/string.h>
...@@ -200,4 +200,4 @@ inline kj::ArrayPtr<char> Text::Builder::slice(size_t start, size_t end) { ...@@ -200,4 +200,4 @@ inline kj::ArrayPtr<char> Text::Builder::slice(size_t start, size_t end) {
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_BLOB_H_ #endif // CAPNP_BLOB_H_
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
// time, but should then be optimized down to basic primitives (usually, integers) by the // time, but should then be optimized down to basic primitives (usually, integers) by the
// compiler. // compiler.
#ifndef CAPNPROTO_COMMON_H_ #ifndef CAPNP_COMMON_H_
#define CAPNPROTO_COMMON_H_ #define CAPNP_COMMON_H_
#include <kj/units.h> #include <kj/units.h>
#include <inttypes.h> #include <inttypes.h>
...@@ -217,4 +217,4 @@ inline constexpr WordCount intervalLength(const word* a, const word* b) { ...@@ -217,4 +217,4 @@ inline constexpr WordCount intervalLength(const word* a, const word* b) {
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_COMMON_H_ #endif // CAPNP_COMMON_H_
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
// As always, underlying data is validated lazily, so you have to actually traverse the whole // As always, underlying data is validated lazily, so you have to actually traverse the whole
// message if you want to validate all content. // message if you want to validate all content.
#ifndef CAPNPROTO_DYNAMIC_H_ #ifndef CAPNP_DYNAMIC_H_
#define CAPNPROTO_DYNAMIC_H_ #define CAPNP_DYNAMIC_H_
#include "schema.h" #include "schema.h"
#include "layout.h" #include "layout.h"
...@@ -730,48 +730,48 @@ DynamicTypeFor<TypeIfEnum<T>> toDynamic(T&& value) { ...@@ -730,48 +730,48 @@ DynamicTypeFor<TypeIfEnum<T>> toDynamic(T&& value) {
inline DynamicValue::Reader::Reader(std::nullptr_t n): type(UNKNOWN) {} inline DynamicValue::Reader::Reader(std::nullptr_t n): type(UNKNOWN) {}
inline DynamicValue::Builder::Builder(std::nullptr_t n): type(UNKNOWN) {} inline DynamicValue::Builder::Builder(std::nullptr_t n): type(UNKNOWN) {}
#define CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(cppType, typeTag, fieldName) \ #define CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(cppType, typeTag, fieldName) \
inline DynamicValue::Reader::Reader(cppType value) \ inline DynamicValue::Reader::Reader(cppType value) \
: type(typeTag), fieldName##Value(value) {} \ : type(typeTag), fieldName##Value(value) {} \
inline DynamicValue::Builder::Builder(cppType value) \ inline DynamicValue::Builder::Builder(cppType value) \
: type(typeTag), fieldName##Value(value) {} : type(typeTag), fieldName##Value(value) {}
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(Void, VOID, void); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(Void, VOID, void);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(bool, BOOL, bool); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(bool, BOOL, bool);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(char, INT, int); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(char, INT, int);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(signed char, INT, int); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(signed char, INT, int);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(short, INT, int); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(short, INT, int);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(int, INT, int); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(int, INT, int);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(long, INT, int); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(long, INT, int);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(long long, INT, int); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(long long, INT, int);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned char, UINT, uint); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned char, UINT, uint);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned short, UINT, uint); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned short, UINT, uint);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned int, UINT, uint); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned int, UINT, uint);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned long, UINT, uint); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned long, UINT, uint);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned long long, UINT, uint); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(unsigned long long, UINT, uint);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(float, FLOAT, float); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(float, FLOAT, float);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(double, FLOAT, float); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(double, FLOAT, float);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicEnum, ENUM, enum); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicEnum, ENUM, enum);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicObject, OBJECT, object); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicObject, OBJECT, object);
#undef CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR #undef CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR
#define CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(cppType, typeTag, fieldName) \ #define CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(cppType, typeTag, fieldName) \
inline DynamicValue::Reader::Reader(const cppType::Reader& value) \ inline DynamicValue::Reader::Reader(const cppType::Reader& value) \
: type(typeTag), fieldName##Value(value) {} \ : type(typeTag), fieldName##Value(value) {} \
inline DynamicValue::Builder::Builder(cppType::Builder value) \ inline DynamicValue::Builder::Builder(cppType::Builder value) \
: type(typeTag), fieldName##Value(value) {} : type(typeTag), fieldName##Value(value) {}
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(Text, TEXT, text); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(Text, TEXT, text);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(Data, DATA, data); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(Data, DATA, data);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicList, LIST, list); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicList, LIST, list);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicStruct, STRUCT, struct); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicStruct, STRUCT, struct);
CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicUnion, UNION, union); CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR(DynamicUnion, UNION, union);
#undef CAPNPROTO_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR #undef CAPNP_DECLARE_DYNAMIC_VALUE_CONSTRUCTOR
inline DynamicValue::Reader::Reader(const char* value): Reader(Text::Reader(value)) {} inline DynamicValue::Reader::Reader(const char* value): Reader(Text::Reader(value)) {}
#define CAPNPROTO_DECLARE_TYPE(name, discrim, typeName) \ #define CAPNP_DECLARE_TYPE(name, discrim, typeName) \
template <> \ template <> \
struct DynamicValue::Reader::AsImpl<typeName> { \ struct DynamicValue::Reader::AsImpl<typeName> { \
static ReaderFor<typeName> apply(const Reader& reader); \ static ReaderFor<typeName> apply(const Reader& reader); \
...@@ -781,29 +781,29 @@ struct DynamicValue::Builder::AsImpl<typeName> { \ ...@@ -781,29 +781,29 @@ struct DynamicValue::Builder::AsImpl<typeName> { \
static BuilderFor<typeName> apply(Builder& builder); \ static BuilderFor<typeName> apply(Builder& builder); \
}; };
//CAPNPROTO_DECLARE_TYPE(void, VOID, Void) //CAPNP_DECLARE_TYPE(void, VOID, Void)
CAPNPROTO_DECLARE_TYPE(bool, BOOL, bool) CAPNP_DECLARE_TYPE(bool, BOOL, bool)
CAPNPROTO_DECLARE_TYPE(int8, INT8, int8_t) CAPNP_DECLARE_TYPE(int8, INT8, int8_t)
CAPNPROTO_DECLARE_TYPE(int16, INT16, int16_t) CAPNP_DECLARE_TYPE(int16, INT16, int16_t)
CAPNPROTO_DECLARE_TYPE(int32, INT32, int32_t) CAPNP_DECLARE_TYPE(int32, INT32, int32_t)
CAPNPROTO_DECLARE_TYPE(int64, INT64, int64_t) CAPNP_DECLARE_TYPE(int64, INT64, int64_t)
CAPNPROTO_DECLARE_TYPE(uint8, UINT8, uint8_t) CAPNP_DECLARE_TYPE(uint8, UINT8, uint8_t)
CAPNPROTO_DECLARE_TYPE(uint16, UINT16, uint16_t) CAPNP_DECLARE_TYPE(uint16, UINT16, uint16_t)
CAPNPROTO_DECLARE_TYPE(uint32, UINT32, uint32_t) CAPNP_DECLARE_TYPE(uint32, UINT32, uint32_t)
CAPNPROTO_DECLARE_TYPE(uint64, UINT64, uint64_t) CAPNP_DECLARE_TYPE(uint64, UINT64, uint64_t)
CAPNPROTO_DECLARE_TYPE(float32, FLOAT32, float) CAPNP_DECLARE_TYPE(float32, FLOAT32, float)
CAPNPROTO_DECLARE_TYPE(float64, FLOAT64, double) CAPNP_DECLARE_TYPE(float64, FLOAT64, double)
CAPNPROTO_DECLARE_TYPE(text, TEXT, Text) CAPNP_DECLARE_TYPE(text, TEXT, Text)
CAPNPROTO_DECLARE_TYPE(data, DATA, Data) CAPNP_DECLARE_TYPE(data, DATA, Data)
CAPNPROTO_DECLARE_TYPE(list, LIST, DynamicList) CAPNP_DECLARE_TYPE(list, LIST, DynamicList)
CAPNPROTO_DECLARE_TYPE(struct, STRUCT, DynamicStruct) CAPNP_DECLARE_TYPE(struct, STRUCT, DynamicStruct)
CAPNPROTO_DECLARE_TYPE(enum, ENUM, DynamicEnum) CAPNP_DECLARE_TYPE(enum, ENUM, DynamicEnum)
CAPNPROTO_DECLARE_TYPE(object, OBJECT, DynamicObject) CAPNP_DECLARE_TYPE(object, OBJECT, DynamicObject)
CAPNPROTO_DECLARE_TYPE(union, UNION, DynamicUnion) CAPNP_DECLARE_TYPE(union, UNION, DynamicUnion)
#undef CAPNPROTO_DECLARE_TYPE #undef CAPNP_DECLARE_TYPE
// CAPNPROTO_DECLARE_TYPE(Void) causes gcc 4.7 to segfault. If I do it manually and remove the // CAPNP_DECLARE_TYPE(Void) causes gcc 4.7 to segfault. If I do it manually and remove the
// ReaderFor<> and BuilderFor<> wrappers, it works. // ReaderFor<> and BuilderFor<> wrappers, it works.
template <> template <>
struct DynamicValue::Reader::AsImpl<Void> { struct DynamicValue::Reader::AsImpl<Void> {
...@@ -933,4 +933,4 @@ inline DynamicList::Builder DynamicList::Builder::as<DynamicList>() { ...@@ -933,4 +933,4 @@ inline DynamicList::Builder DynamicList::Builder::as<DynamicList>() {
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_DYNAMIC_H_ #endif // CAPNP_DYNAMIC_H_
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
// This file is included form all generated headers. // This file is included form all generated headers.
#ifndef CAPNPROTO_GENERATED_HEADER_SUPPORT_H_ #ifndef CAPNP_GENERATED_HEADER_SUPPORT_H_
#define CAPNPROTO_GENERATED_HEADER_SUPPORT_H_ #define CAPNP_GENERATED_HEADER_SUPPORT_H_
#include "layout.h" #include "layout.h"
#include "list.h" #include "list.h"
...@@ -202,17 +202,17 @@ inline constexpr uint64_t typeId() { return internal::TypeId_<T>::typeId; } ...@@ -202,17 +202,17 @@ inline constexpr uint64_t typeId() { return internal::TypeId_<T>::typeId; }
} // namespace capnp } // namespace capnp
#define CAPNPROTO_DECLARE_ENUM(type, id) \ #define CAPNP_DECLARE_ENUM(type, id) \
template <> struct Kind_<type> { static constexpr Kind kind = Kind::ENUM; }; \ template <> struct Kind_<type> { static constexpr Kind kind = Kind::ENUM; }; \
template <> struct TypeId_<type> { static constexpr uint64_t typeId = 0x##id; }; \ template <> struct TypeId_<type> { static constexpr uint64_t typeId = 0x##id; }; \
template <> struct RawSchema_<type> { \ template <> struct RawSchema_<type> { \
static inline const RawSchema& get() { return schemas::s_##id; } \ static inline const RawSchema& get() { return schemas::s_##id; } \
} }
#define CAPNPROTO_DEFINE_ENUM(type) \ #define CAPNP_DEFINE_ENUM(type) \
constexpr Kind Kind_<type>::kind; \ constexpr Kind Kind_<type>::kind; \
constexpr uint64_t TypeId_<type>::typeId; constexpr uint64_t TypeId_<type>::typeId;
#define CAPNPROTO_DECLARE_STRUCT(type, id, dataWordSize, pointerCount, preferredElementEncoding) \ #define CAPNP_DECLARE_STRUCT(type, id, dataWordSize, pointerCount, preferredElementEncoding) \
template <> struct Kind_<type> { static constexpr Kind kind = Kind::STRUCT; }; \ template <> struct Kind_<type> { static constexpr Kind kind = Kind::STRUCT; }; \
template <> struct StructSize_<type> { \ template <> struct StructSize_<type> { \
static constexpr StructSize value = StructSize( \ static constexpr StructSize value = StructSize( \
...@@ -222,27 +222,27 @@ inline constexpr uint64_t typeId() { return internal::TypeId_<T>::typeId; } ...@@ -222,27 +222,27 @@ inline constexpr uint64_t typeId() { return internal::TypeId_<T>::typeId; }
template <> struct RawSchema_<type> { \ template <> struct RawSchema_<type> { \
static inline const RawSchema& get() { return schemas::s_##id; } \ static inline const RawSchema& get() { return schemas::s_##id; } \
} }
#define CAPNPROTO_DEFINE_STRUCT(type) \ #define CAPNP_DEFINE_STRUCT(type) \
constexpr Kind Kind_<type>::kind; \ constexpr Kind Kind_<type>::kind; \
constexpr StructSize StructSize_<type>::value; \ constexpr StructSize StructSize_<type>::value; \
constexpr uint64_t TypeId_<type>::typeId; constexpr uint64_t TypeId_<type>::typeId;
#define CAPNPROTO_DECLARE_UNION(type, parentType, memberIndex) \ #define CAPNP_DECLARE_UNION(type, parentType, memberIndex) \
template <> struct Kind_<type> { static constexpr Kind kind = Kind::UNION; }; \ template <> struct Kind_<type> { static constexpr Kind kind = Kind::UNION; }; \
template <> struct UnionMemberIndex_<type> { static constexpr uint value = memberIndex; }; \ template <> struct UnionMemberIndex_<type> { static constexpr uint value = memberIndex; }; \
template <> struct UnionParentType_<type> { typedef parentType Type; } template <> struct UnionParentType_<type> { typedef parentType Type; }
#define CAPNPROTO_DEFINE_UNION(type) \ #define CAPNP_DEFINE_UNION(type) \
constexpr Kind Kind_<type>::kind; \ constexpr Kind Kind_<type>::kind; \
constexpr uint UnionMemberIndex_<type>::value; constexpr uint UnionMemberIndex_<type>::value;
#define CAPNPROTO_DECLARE_INTERFACE(type, id) \ #define CAPNP_DECLARE_INTERFACE(type, id) \
template <> struct Kind_<type> { static constexpr Kind kind = Kind::INTERFACE; }; \ template <> struct Kind_<type> { static constexpr Kind kind = Kind::INTERFACE; }; \
template <> struct TypeId_<type> { static constexpr uint64_t typeId = 0x##id; }; \ template <> struct TypeId_<type> { static constexpr uint64_t typeId = 0x##id; }; \
template <> struct RawSchema_<type> { \ template <> struct RawSchema_<type> { \
static inline const RawSchema& get() { return schemas::s_##id; } \ static inline const RawSchema& get() { return schemas::s_##id; } \
} }
#define CAPNPROTO_DEFINE_INTERFACE(type) \ #define CAPNP_DEFINE_INTERFACE(type) \
constexpr Kind Kind_<type>::kind; \ constexpr Kind Kind_<type>::kind; \
constexpr uint64_t TypeId_<type>::typeId; constexpr uint64_t TypeId_<type>::typeId;
#endif // CAPNPROTO_GENERATED_HEADER_SUPPORT_H_ #endif // CAPNP_GENERATED_HEADER_SUPPORT_H_
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CAPNPROTO_PRIVATE #define CAPNP_PRIVATE
#include "layout.h" #include "layout.h"
#include "message.h" #include "message.h"
#include "arena.h" #include "arena.h"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CAPNPROTO_PRIVATE #define CAPNP_PRIVATE
#include "layout.h" #include "layout.h"
#include <kj/debug.h> #include <kj/debug.h>
#include "arena.h" #include "arena.h"
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
// as does other parts of the Cap'n proto library which provide a higher-level interface for // as does other parts of the Cap'n proto library which provide a higher-level interface for
// dynamic introspection. // dynamic introspection.
#ifndef CAPNPROTO_LAYOUT_H_ #ifndef CAPNP_LAYOUT_H_
#define CAPNPROTO_LAYOUT_H_ #define CAPNP_LAYOUT_H_
#include <kj/common.h> #include <kj/common.h>
#include "common.h" #include "common.h"
...@@ -894,4 +894,4 @@ template <> typename Data::Reader ListReader::getBlobElement<Data>(ElementCount ...@@ -894,4 +894,4 @@ template <> typename Data::Reader ListReader::getBlobElement<Data>(ElementCount
} // namespace internal } // namespace internal
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_LAYOUT_H_ #endif // CAPNP_LAYOUT_H_
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_LIST_H_ #ifndef CAPNP_LIST_H_
#define CAPNPROTO_LIST_H_ #define CAPNP_LIST_H_
#include "layout.h" #include "layout.h"
#include <initializer_list> #include <initializer_list>
...@@ -549,4 +549,4 @@ private: ...@@ -549,4 +549,4 @@ private:
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_LIST_H_ #endif // CAPNP_LIST_H_
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CAPNPROTO_PRIVATE #define CAPNP_PRIVATE
#include "message.h" #include "message.h"
#include <kj/debug.h> #include <kj/debug.h>
#include "arena.h" #include "arena.h"
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include "list.h" // TODO(cleanup): For FromReader. Move elsewhere? #include "list.h" // TODO(cleanup): For FromReader. Move elsewhere?
#ifndef CAPNPROTO_MESSAGE_H_ #ifndef CAPNP_MESSAGE_H_
#define CAPNPROTO_MESSAGE_H_ #define CAPNP_MESSAGE_H_
namespace capnp { namespace capnp {
...@@ -370,4 +370,4 @@ static typename Type::Reader defaultValue() { ...@@ -370,4 +370,4 @@ static typename Type::Reader defaultValue() {
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_MESSAGE_H_ #endif // CAPNP_MESSAGE_H_
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CAPNPROTO_PRIVATE #define CAPNP_PRIVATE
#include "schema-loader.h" #include "schema-loader.h"
#include <unordered_map> #include <unordered_map>
#include <map> #include <map>
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_SCHEMA_LOADER_H_ #ifndef CAPNP_SCHEMA_LOADER_H_
#define CAPNPROTO_SCHEMA_LOADER_H_ #define CAPNP_SCHEMA_LOADER_H_
#include "schema.h" #include "schema.h"
#include <kj/memory.h> #include <kj/memory.h>
...@@ -108,4 +108,4 @@ inline void SchemaLoader::loadCompiledTypeAndDependencies() { ...@@ -108,4 +108,4 @@ inline void SchemaLoader::loadCompiledTypeAndDependencies() {
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_SCHEMA_LOADER_H_ #endif // CAPNP_SCHEMA_LOADER_H_
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_SCHEMA_H_ #ifndef CAPNP_SCHEMA_H_
#define CAPNPROTO_SCHEMA_H_ #define CAPNP_SCHEMA_H_
#include "schema.capnp.h" #include "schema.capnp.h"
...@@ -468,4 +468,4 @@ struct ListSchema::FromImpl<List<T>> { ...@@ -468,4 +468,4 @@ struct ListSchema::FromImpl<List<T>> {
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_SCHEMA_H_ #endif // CAPNP_SCHEMA_H_
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_SERIALIZE_PACKED_H_ #ifndef CAPNP_SERIALIZE_PACKED_H_
#define CAPNPROTO_SERIALIZE_PACKED_H_ #define CAPNP_SERIALIZE_PACKED_H_
#include "serialize.h" #include "serialize.h"
...@@ -121,4 +121,4 @@ inline void writePackedMessageToFd(int fd, MessageBuilder& builder) { ...@@ -121,4 +121,4 @@ inline void writePackedMessageToFd(int fd, MessageBuilder& builder) {
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_SERIALIZE_PACKED_H_ #endif // CAPNP_SERIALIZE_PACKED_H_
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_SERIALIZE_SNAPPY_H_ #ifndef CAPNP_SERIALIZE_SNAPPY_H_
#define CAPNPROTO_SERIALIZE_SNAPPY_H_ #define CAPNP_SERIALIZE_SNAPPY_H_
#include "serialize.h" #include "serialize.h"
#include "serialize-packed.h" #include "serialize-packed.h"
...@@ -108,4 +108,4 @@ inline void writeSnappyPackedMessage(kj::OutputStream& output, MessageBuilder& b ...@@ -108,4 +108,4 @@ inline void writeSnappyPackedMessage(kj::OutputStream& output, MessageBuilder& b
} // namespace capnp } // namespace capnp
#endif // CAPNPROTO_SERIALIZE_SNAPPY_H_ #endif // CAPNP_SERIALIZE_SNAPPY_H_
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
// - A multi-segment message can be read entirely in three system calls with no buffering. // - A multi-segment message can be read entirely in three system calls with no buffering.
// - The format is appropriate for mmap()ing since all data is aligned. // - The format is appropriate for mmap()ing since all data is aligned.
#ifndef CAPNPROTO_SERIALIZE_H_ #ifndef CAPNP_SERIALIZE_H_
#define CAPNPROTO_SERIALIZE_H_ #define CAPNP_SERIALIZE_H_
#include "message.h" #include "message.h"
#include <kj/io.h> #include <kj/io.h>
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CAPNPROTO_TEST_UTIL_H_ #ifndef CAPNP_TEST_UTIL_H_
#define CAPNPROTO_TEST_UTIL_H_ #define CAPNP_TEST_UTIL_H_
#include "test.capnp.h" #include "test.capnp.h"
#include <iostream> #include <iostream>
......
...@@ -530,7 +530,7 @@ outerFileContext schemaNodes = fileContext where ...@@ -530,7 +530,7 @@ outerFileContext schemaNodes = fileContext where
context "fileName" = MuVariable $ fileName desc context "fileName" = MuVariable $ fileName desc
context "fileBasename" = MuVariable $ takeBaseName $ fileName desc context "fileBasename" = MuVariable $ takeBaseName $ fileName desc
context "fileIncludeGuard" = MuVariable $ context "fileIncludeGuard" = MuVariable $
"CAPNPROTO_INCLUDED_" ++ hashString (fileName desc ++ ':':show (fileId desc)) "CAPNP_INCLUDED_" ++ hashString (fileName desc ++ ':':show (fileId desc))
context "fileNamespaces" = MuList $ map (namespaceContext context) namespace context "fileNamespaces" = MuList $ map (namespaceContext context) namespace
context "fileEnums" = MuList $ map (enumContext context) [e | DescEnum e <- fileMembers desc] context "fileEnums" = MuList $ map (enumContext context) [e | DescEnum e <- fileMembers desc]
context "fileTypes" = MuList $ map (typeContext context) flattenedMembers context "fileTypes" = MuList $ map (typeContext context) flattenedMembers
......
...@@ -114,15 +114,15 @@ namespace internal { ...@@ -114,15 +114,15 @@ namespace internal {
{{#fileTypes}} {{#fileTypes}}
{{#typeStructOrUnion}} {{#typeStructOrUnion}}
{{#typeStruct}} {{#typeStruct}}
CAPNPROTO_DECLARE_STRUCT( CAPNP_DECLARE_STRUCT(
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{typeFullName}}, {{structId}}, ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{typeFullName}}, {{structId}},
{{structDataSize}}, {{structPointerCount}}, {{structPreferredListEncoding}}); {{structDataSize}}, {{structPointerCount}}, {{structPreferredListEncoding}});
{{#structNestedEnums}} {{#structNestedEnums}}
CAPNPROTO_DECLARE_ENUM( CAPNP_DECLARE_ENUM(
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{typeFullName}}::{{enumName}}, {{enumId}}); ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{typeFullName}}::{{enumName}}, {{enumId}});
{{/structNestedEnums}} {{/structNestedEnums}}
{{#structUnions}} {{#structUnions}}
CAPNPROTO_DECLARE_UNION( CAPNP_DECLARE_UNION(
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{structFullName}}::{{unionTitleCase}}, ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{structFullName}}::{{unionTitleCase}},
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{structFullName}}, {{unionIndex}}); ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{structFullName}}, {{unionIndex}});
{{/structUnions}} {{/structUnions}}
...@@ -130,7 +130,7 @@ CAPNPROTO_DECLARE_UNION( ...@@ -130,7 +130,7 @@ CAPNPROTO_DECLARE_UNION(
{{/typeStructOrUnion}} {{/typeStructOrUnion}}
{{/fileTypes}} {{/fileTypes}}
{{#fileEnums}} {{#fileEnums}}
CAPNPROTO_DECLARE_ENUM( CAPNP_DECLARE_ENUM(
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{enumName}}, {{enumId}}); ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{enumName}}, {{enumId}});
{{/fileEnums}} {{/fileEnums}}
} // namespace capnp } // namespace capnp
......
...@@ -79,21 +79,21 @@ namespace internal { ...@@ -79,21 +79,21 @@ namespace internal {
{{#fileTypes}} {{#fileTypes}}
{{#typeStructOrUnion}} {{#typeStructOrUnion}}
{{#typeStruct}} {{#typeStruct}}
CAPNPROTO_DEFINE_STRUCT( CAPNP_DEFINE_STRUCT(
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{typeFullName}}); ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{typeFullName}});
{{#structNestedEnums}} {{#structNestedEnums}}
CAPNPROTO_DEFINE_ENUM( CAPNP_DEFINE_ENUM(
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{typeFullName}}::{{enumName}}); ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{typeFullName}}::{{enumName}});
{{/structNestedEnums}} {{/structNestedEnums}}
{{#structUnions}} {{#structUnions}}
CAPNPROTO_DEFINE_UNION( CAPNP_DEFINE_UNION(
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{structFullName}}::{{unionTitleCase}}); ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{structFullName}}::{{unionTitleCase}});
{{/structUnions}} {{/structUnions}}
{{/typeStruct}} {{/typeStruct}}
{{/typeStructOrUnion}} {{/typeStructOrUnion}}
{{/fileTypes}} {{/fileTypes}}
{{#fileEnums}} {{#fileEnums}}
CAPNPROTO_DEFINE_ENUM( CAPNP_DEFINE_ENUM(
::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{enumName}}); ::{{#fileNamespaces}}{{namespaceName}}::{{/fileNamespaces}}{{enumName}});
{{/fileEnums}} {{/fileEnums}}
} // namespace internal } // namespace internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment