From 0d41be3790b2f221621ec8bbd7f365508683cb18 Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Tue, 3 Oct 2017 18:08:34 +0200 Subject: [PATCH 1/2] [GDnative] add api version field to godot_gdnative_api_struct --- modules/gdnative/SCsub | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 31178be973..22e3cbc784 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -29,7 +29,8 @@ def _build_gdnative_api_struct_header(api): 'extern "C" {', '#endif', '', - 'typedef struct godot_gdnative_api_struct {' + 'typedef struct godot_gdnative_api_struct {', + '\tconst char *version;', ] for funcname, funcdef in api['api'].items(): @@ -54,7 +55,9 @@ def _build_gdnative_api_struct_source(api): '', '#include ', '', - 'extern const godot_gdnative_api_struct api_struct = {' + 'const char *_gdnative_api_version = "%s";' % api['version'], + 'extern const godot_gdnative_api_struct api_struct = {', + '\t_gdnative_api_version,', ] for funcname in api['api'].keys(): From 3e29cb806cc64a2700e341faa919ace4f1dbe2a8 Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Wed, 4 Oct 2017 03:11:41 +0200 Subject: [PATCH 2/2] [GDnative] add future-proof next field to godot_gdnative_api_struct (a la Vulkan) --- modules/gdnative/SCsub | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 22e3cbc784..f8a0d292c4 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -30,6 +30,7 @@ def _build_gdnative_api_struct_header(api): '#endif', '', 'typedef struct godot_gdnative_api_struct {', + '\tvoid *next;', '\tconst char *version;', ] @@ -57,6 +58,7 @@ def _build_gdnative_api_struct_source(api): '', 'const char *_gdnative_api_version = "%s";' % api['version'], 'extern const godot_gdnative_api_struct api_struct = {', + '\tNULL,', '\t_gdnative_api_version,', ]