Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/NMTCreator.h
/* Copyright (C) 2015 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | |||||
#define BAIL_DESERIALIZER return NULL | #define BAIL_DESERIALIZER return NULL | ||||
#define START_NMT_CLASS(_nm, _tp) \ | #define START_NMT_CLASS(_nm, _tp) \ | ||||
START_NMT_CLASS_DERIVED(CNetMessage, _nm, _tp) | START_NMT_CLASS_DERIVED(CNetMessage, _nm, _tp) | ||||
#define START_NMT_CLASS_DERIVED(_base, _nm, _tp) \ | #define START_NMT_CLASS_DERIVED(_base, _nm, _tp) \ | ||||
const u8 *_nm::Deserialize(const u8 *pos, const u8 *end) \ | const u8 *_nm::Deserialize(const u8 *pos, const u8 *end) \ | ||||
{ \ | { \ | ||||
pos=_base::Deserialize(pos, end); \ | pos=_base::Deserialize(pos, end); \ | ||||
if (pos == NULL) BAIL_DESERIALIZER;\ | |||||
_nm *thiz=this; \ | _nm *thiz=this; \ | ||||
/*printf("In Deserialize" #_nm "\n"); */\ | /*printf("In Deserialize" #_nm "\n"); */\ | ||||
UNUSED2(thiz); // preempt any "unused" warning | UNUSED2(thiz); // preempt any "unused" warning | ||||
#define NMT_START_ARRAY(_nm) \ | #define NMT_START_ARRAY(_nm) \ | ||||
while (pos < end) \ | while (pos < end) \ | ||||
{ \ | { \ | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator