From f484c603a81c3bddd3f0160cfdbe231b8a453cde Mon Sep 17 00:00:00 2001
From: Leo P <junk@slact.net>
Date: Wed, 24 Jun 2020 15:28:07 -0400
Subject: [PATCH] GCC 10 compatibility
Origin: https://github.com/slact/nchan/commit/f484c603a81c3bddd3f0160cfdbe231b8a453cde

---
 src/store/memory/memstore.c          | 2 ++
 src/store/memory/store-private.h     | 2 +-
 src/store/redis/redis_lua_commands.h | 7 +++++--
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/store/memory/memstore.c b/src/store/memory/memstore.c
index 2844220c..f0f78acc 100755
--- a/src/store/memory/memstore.c
+++ b/src/store/memory/memstore.c
@@ -40,6 +40,8 @@ static ngx_int_t redis_fakesub_timer_interval;
 
 #endif
 
+uint16_t  memstore_worker_generation;
+
 
 typedef struct {
   //memstore_channel_head_t       unbuffered_dummy_chanhead;
diff --git a/src/store/memory/store-private.h b/src/store/memory/store-private.h
index e4a426a3..49de940b 100644
--- a/src/store/memory/store-private.h
+++ b/src/store/memory/store-private.h
@@ -172,6 +172,6 @@ ngx_int_t chanhead_gc_withdraw(memstore_channel_head_t *chanhead, const char *);
 void memstore_chanhead_release(memstore_channel_head_t *ch, char *label);
 void memstore_chanhead_reserve(memstore_channel_head_t *ch, const char *label);
 
-uint16_t  memstore_worker_generation; //times nginx has been restarted + 1
+extern uint16_t  memstore_worker_generation; //times nginx has been restarted + 1
 
 #endif /*MEMSTORE_PRIVATE_HEADER*/
diff --git a/src/store/redis/redis_lua_commands.h b/src/store/redis/redis_lua_commands.h
index 76fb7b95..2efb25bd 100644
--- a/src/store/redis/redis_lua_commands.h
+++ b/src/store/redis/redis_lua_commands.h
@@ -1,3 +1,5 @@
+#ifndef NCHAN_REDIS_LUA_SCRIPTS_H
+#define NCHAN_REDIS_LUA_SCRIPTS_H
 // don't edit this please, it was auto-generated by hsss
 // https://github.com/slact/hsss
 
@@ -63,7 +65,8 @@ typedef struct {
   redis_lua_script_t subscriber_unregister;
 
 } redis_lua_scripts_t;
-redis_lua_scripts_t redis_lua_scripts;
-const int redis_lua_scripts_count;
+extern redis_lua_scripts_t redis_lua_scripts;
+extern const int redis_lua_scripts_count;
 #define REDIS_LUA_SCRIPTS_EACH(script) \
 for((script)=(redis_lua_script_t *)&redis_lua_scripts; (script) < (redis_lua_script_t *)(&redis_lua_scripts + 1); (script)++) 
+#endif //NCHAN_REDIS_LUA_SCRIPTS_H
