From 7638e1937083f6da076e5c469c14acc32f65ba49 Mon Sep 17 00:00:00 2001
From: Robert Scheck <robert@fedoraproject.org>
Date: Sun, 2 Feb 2020 23:13:06 +0100
Subject: [PATCH] Declare variables as extern in headers (fixes #136)

GCC 10 compatibility as per https://gcc.gnu.org/gcc-10/porting_to.html

See also:
 - https://github.com/Thomas-Tsai/partclone/issues/136
 - https://github.com/Thomas-Tsai/partclone/pull/137
---
 src/partclone.c | 1 +
 src/partclone.h | 4 ++--
 src/xfsclone.c  | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/partclone.c b/src/partclone.c
index 98365043..e264cbb1 100644
--- a/src/partclone.c
+++ b/src/partclone.c
@@ -55,6 +55,7 @@
 
 
 FILE* msg = NULL;
+unsigned long long rescue_write_size;
 #ifdef HAVE_LIBNCURSESW
 #include <ncurses.h>
 WINDOW *log_win;
diff --git a/src/partclone.h b/src/partclone.h
index 5188e290..3dc2ef1b 100644
--- a/src/partclone.h
+++ b/src/partclone.h
@@ -80,8 +80,8 @@ const char* get_exec_name();
 #undef crc32
 #endif
 
-char *EXECNAME;
-unsigned long long rescue_write_size;
+extern char *EXECNAME;
+extern unsigned long long rescue_write_size;
 
 /**
  * option
diff --git a/src/xfsclone.c b/src/xfsclone.c
index 522431ab..6f807e90 100644
--- a/src/xfsclone.c
+++ b/src/xfsclone.c
@@ -24,7 +24,7 @@
 #undef crc32
 int	source_fd = -1;
 int     first_residue;
-progress_bar        prog;
+extern progress_bar prog;
 unsigned long long checked;
 unsigned long long total_block;
 int bitmap_done = 0;
