add version checks
This commit is contained in:
parent
fc63a080a0
commit
7b0bfece26
5 changed files with 21 additions and 1 deletions
2
capn.h
2
capn.h
|
|
@ -16,6 +16,8 @@ extern "C" {
|
||||||
#define CAPN_INLINE static
|
#define CAPN_INLINE static
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define CAPN_VERSION 1
|
||||||
|
|
||||||
/* struct capn is a common structure shared between segments in the same
|
/* struct capn is a common structure shared between segments in the same
|
||||||
* session/context so that far pointers between segments will be created.
|
* session/context so that far pointers between segments will be created.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,11 @@
|
||||||
/* AUTO GENERATED - DO NOT EDIT */
|
/* AUTO GENERATED - DO NOT EDIT */
|
||||||
#include <capn.h>
|
#include <capn.h>
|
||||||
|
|
||||||
|
#if CAPN_VERSION != 1
|
||||||
|
#error "version mismatch between capn.h and generated code"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1152,7 +1152,10 @@ int main() {
|
||||||
str_addf(&HDR, "#ifndef CAPN_%X%X\n", (uint32_t) (file_node->n.id >> 32), (uint32_t) file_node->n.id);
|
str_addf(&HDR, "#ifndef CAPN_%X%X\n", (uint32_t) (file_node->n.id >> 32), (uint32_t) file_node->n.id);
|
||||||
str_addf(&HDR, "#define CAPN_%X%X\n", (uint32_t) (file_node->n.id >> 32), (uint32_t) file_node->n.id);
|
str_addf(&HDR, "#define CAPN_%X%X\n", (uint32_t) (file_node->n.id >> 32), (uint32_t) file_node->n.id);
|
||||||
str_addf(&HDR, "/* AUTO GENERATED - DO NOT EDIT */\n");
|
str_addf(&HDR, "/* AUTO GENERATED - DO NOT EDIT */\n");
|
||||||
str_addf(&HDR, "#include <capn.h>\n");
|
str_addf(&HDR, "#include <capn.h>\n\n");
|
||||||
|
str_addf(&HDR, "#if CAPN_VERSION != 1\n");
|
||||||
|
str_addf(&HDR, "#error \"version mismatch between capn.h and generated code\"\n");
|
||||||
|
str_addf(&HDR, "#endif\n\n");
|
||||||
|
|
||||||
capn_resolve(&file_req.imports.p);
|
capn_resolve(&file_req.imports.p);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,11 @@
|
||||||
#define CAPN_A93FC509624C72D9
|
#define CAPN_A93FC509624C72D9
|
||||||
/* AUTO GENERATED - DO NOT EDIT */
|
/* AUTO GENERATED - DO NOT EDIT */
|
||||||
#include <capn.h>
|
#include <capn.h>
|
||||||
|
|
||||||
|
#if CAPN_VERSION != 1
|
||||||
|
#error "version mismatch between capn.h and generated code"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "c++.capnp.h"
|
#include "c++.capnp.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,11 @@
|
||||||
#define CAPN_D508EEBDC2DC42B8
|
#define CAPN_D508EEBDC2DC42B8
|
||||||
/* AUTO GENERATED - DO NOT EDIT */
|
/* AUTO GENERATED - DO NOT EDIT */
|
||||||
#include <capn.h>
|
#include <capn.h>
|
||||||
|
|
||||||
|
#if CAPN_VERSION != 1
|
||||||
|
#error "version mismatch between capn.h and generated code"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "c++.capnp.h"
|
#include "c++.capnp.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue