From 6aff8a132815a84bab69401c1e7de96ec549fbf2 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 10 Feb 2020 16:37:34 +0100 Subject: build: Always use EXTERN_UNLESS_MAIN_MODULE pattern. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * common/util.h (EXTERN_UNLESS_MAIN_MODULE): Add the definion only here but now without the Norcroft-C. Change all other places where it gets defined. * common/iobuf.h (iobuf_debug_mode): Declare unconditionally as extern. * common/iobuf.c (iobuf_debug_mode): Define it here. * agent/gpg-agent.c (INCLUDED_BY_MAIN_MODULE): Define here and also in all main modules of all other programs. * g10/main.h: Put util.h before the local header files. -- This change is required for use with gcc/ld's LTO feature which does not allow common blocks. Further gcc 10 will make -fno-common the default and thus this chnage is always needed. What a pitty. Co-authored-by: Tomáš Mráz GnuPG-bug-id: 4831 Signed-off-by: Werner Koch (cherry picked from commit 21d9bd8b87a9f793a106095e3838eb71825189d7) - Applied respective chnages also to gpg-card and keyboxd. Signed-off-by: Werner Koch --- common/iobuf.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'common/iobuf.h') diff --git a/common/iobuf.h b/common/iobuf.h index 9c9650c61..a3d9bd547 100644 --- a/common/iobuf.h +++ b/common/iobuf.h @@ -249,14 +249,7 @@ struct iobuf_struct int subno; }; -#ifndef EXTERN_UNLESS_MAIN_MODULE -#if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE) -#define EXTERN_UNLESS_MAIN_MODULE extern -#else -#define EXTERN_UNLESS_MAIN_MODULE -#endif -#endif -EXTERN_UNLESS_MAIN_MODULE int iobuf_debug_mode; +extern int iobuf_debug_mode; /* Change the default size for all IOBUFs to KILOBYTE. This needs to -- cgit v1.2.3