]> arthur.barton.de Git - ngircd.git/commitdiff
Unbreak GCC 10 (-fno-common) build
authormichi <michi+ngircd@dataswamp.org>
Tue, 14 Apr 2020 14:53:02 +0000 (16:53 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 19 Apr 2020 22:20:46 +0000 (00:20 +0200)
src/ngircd/conn.c
src/ngircd/conn.h
src/ngircd/ngircd.c
src/portab/portab.h

index f62e96754fa9ef610ef556f246f7b6f3711648cd..e14e6c08037aa53e57fd40825bba446313ef1b68 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #define CONN_MODULE
+#define CONN_MODULE_GLOBAL_INIT
 
 #include "portab.h"
 
index c642541f07ce486b712f5a3b0e719a438d9ea8da..869477f091f69f2f9ed2d7f6b40dbb8c7109a85b 100644 (file)
@@ -105,9 +105,17 @@ typedef struct _Connection
 #endif
 } CONNECTION;
 
-GLOBAL CONNECTION *My_Connections;
-GLOBAL CONN_ID Pool_Size;
-GLOBAL long WCounter;
+
+#ifdef CONN_MODULE_GLOBAL_INIT
+CONNECTION *My_Connections;
+CONN_ID Pool_Size;
+long WCounter;
+#else
+extern CONNECTION *My_Connections;
+extern CONN_ID Pool_Size;
+extern long WCounter;
+#endif
+
 
 #define CONNECTION2ID(x) (long)(x - My_Connections)
 
index 7166640ba054288c08030f331ddf9c9724e0a073..41255ca0d97eab650f96ef147fd7ceedb9bc34e3 100644 (file)
@@ -9,6 +9,7 @@
  * Please read the file COPYING, README and AUTHORS for more information.
  */
 
+#define GLOBAL_INIT
 #include "portab.h"
 
 /**
index 70d5ed3ed26327fb14722df062b2a6b834bb6d93..43f2f9070c20caa28cdeee403d80b177dfa95b91 100644 (file)
@@ -102,7 +102,11 @@ typedef unsigned char bool;
 #endif
 
 #undef GLOBAL
+#ifdef GLOBAL_INIT
 #define GLOBAL
+#else
+#define GLOBAL extern
+#endif
 
 /* SPLint */