aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfooxax <xaxes@foonative.org>2020-12-13 14:54:13 +0100
committerfooxax <xaxes@foonative.org>2020-12-13 15:01:17 +0100
commita50564584f51599205f59e476a41c34a5bcee390 (patch)
tree7e320b5a29993e2b13ff6dc24d6a2e330dd3328f
parenta8dd26bec6ce2790c421d5973fc0335042875922 (diff)
downloadparamano-a50564584f51599205f59e476a41c34a5bcee390.tar.xz
Avoid duplicate definition of global default variables
With GCC 10 several things got changed. One of the things is the -fno-common default which prevented the code to link cause of multiple definition issues. Declared the variables extern and defined them in c-file to avoid the linker error. Details can be found here: https://gcc.gnu.org/gcc-10/porting_to.html
-rw-r--r--defaults.c8
-rw-r--r--defaults.h14
2 files changed, 15 insertions, 7 deletions
diff --git a/defaults.c b/defaults.c
index 1f6e8ec..cebf332 100644
--- a/defaults.c
+++ b/defaults.c
@@ -3,6 +3,14 @@
#include <stddef.h>
#include <stdio.h>
+char* DEFAULT_GOV;
+char* DEFAULT_FREQ;
+char* DEFAULT_PROG;
+char* DEFAULT_BAT_GOV;
+char* DEFAULT_AC_GOV;
+bool DEFAULT_SHOW_BATTERY;
+char DEFAULT_THEME[1024];
+
void defaults_init()
{
DEFAULT_GOV = NULL;
diff --git a/defaults.h b/defaults.h
index 9a1f36c..b6c149f 100644
--- a/defaults.h
+++ b/defaults.h
@@ -1,12 +1,12 @@
#include <stdbool.h>
-char* DEFAULT_GOV;
-char* DEFAULT_FREQ;
-char* DEFAULT_PROG;
-char* DEFAULT_BAT_GOV;
-char* DEFAULT_AC_GOV;
-bool DEFAULT_SHOW_BATTERY;
-char DEFAULT_THEME[1024];
+extern char* DEFAULT_GOV;
+extern char* DEFAULT_FREQ;
+extern char* DEFAULT_PROG;
+extern char* DEFAULT_BAT_GOV;
+extern char* DEFAULT_AC_GOV;
+extern bool DEFAULT_SHOW_BATTERY;
+extern char DEFAULT_THEME[1024];
void defaults_init();