[gnome-screenshot] screenshot-config: make proper use of 'extern'



commit 9c53100017ec52d5f2940ba94fbf095764b2deed
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Jul 12 13:43:22 2013 -0400

    screenshot-config: make proper use of 'extern'
    
    Variables in header files should have 'extern' on them and be defined
    from a single .c file, otherwise you get a copy of the variable every
    time you #include the header.
    
    -fcommon masks this problem, but building with -fno-common fails because
    of it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704123

 src/screenshot-config.c |    2 ++
 src/screenshot-config.h |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/screenshot-config.c b/src/screenshot-config.c
index 82fe438..55d410e 100644
--- a/src/screenshot-config.c
+++ b/src/screenshot-config.c
@@ -33,6 +33,8 @@
 #define AUTO_SAVE_DIRECTORY_KEY "auto-save-directory"
 #define LAST_SAVE_DIRECTORY_KEY "last-save-directory"
 
+ScreenshotConfig *screenshot_config;
+
 gboolean
 screenshot_load_config (gboolean clipboard_arg,
                         gboolean window_arg,
diff --git a/src/screenshot-config.h b/src/screenshot-config.h
index 8fa2d0c..d229f8f 100644
--- a/src/screenshot-config.h
+++ b/src/screenshot-config.h
@@ -47,7 +47,7 @@ typedef struct {
   gboolean interactive;
 } ScreenshotConfig;
 
-ScreenshotConfig *screenshot_config;
+extern ScreenshotConfig *screenshot_config;
 
 gboolean screenshot_load_config (gboolean clipboard_arg,
                                  gboolean window_arg,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]