From: Ivan Maidanski Date: Tue, 13 Nov 2018 22:24:13 +0000 (+0300) Subject: Remove redundant header double-inclusion checks in the private headers X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f837f7a7a9f6d82939f85fa754f7b0001ee5f8f;p=gc Remove redundant header double-inclusion checks in the private headers (code refactoring) * include/private/gc_pmark.h [HAVE_CONFIG_H]: Include config.h regardless of GC_PRIVATE_H. * include/private/gc_pmark.h: Include gc_mark.h regardless of GC_MARK_H; include gc_priv.h regardless of GC_PRIVATE_H. * include/private/gc_priv.h: Include gc_tiny_fl.h regardless of GC_TINY_FL_H; include gc_mark.h regardless of GC_MARK_H; include gcconfig.h regardless of GCCONFIG_H; include gc_locks.h regardless of GC_LOCKS_H. --- diff --git a/include/private/gc_pmark.h b/include/private/gc_pmark.h index 5e698f97..3bc34108 100644 --- a/include/private/gc_pmark.h +++ b/include/private/gc_pmark.h @@ -22,7 +22,7 @@ #ifndef GC_PMARK_H #define GC_PMARK_H -#if defined(HAVE_CONFIG_H) && !defined(GC_PRIVATE_H) +#ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -40,13 +40,8 @@ # include "dbg_mlc.h" #endif -#ifndef GC_MARK_H -# include "../gc_mark.h" -#endif - -#ifndef GC_PRIVATE_H -# include "gc_priv.h" -#endif +#include "../gc_mark.h" +#include "gc_priv.h" EXTERN_C_BEGIN diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 9274d1bc..ed45dcda 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -80,13 +80,8 @@ # endif #endif -#ifndef GC_TINY_FL_H -# include "../gc_tiny_fl.h" -#endif - -#ifndef GC_MARK_H -# include "../gc_mark.h" -#endif +#include "../gc_tiny_fl.h" +#include "../gc_mark.h" typedef GC_word word; typedef GC_signed_word signed_word; @@ -122,9 +117,7 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ #define SIZET_SAT_ADD(a, b) \ (EXPECT((a) < GC_SIZE_MAX - (b), TRUE) ? (a) + (b) : GC_SIZE_MAX) -#ifndef GCCONFIG_H -# include "gcconfig.h" -#endif +#include "gcconfig.h" #if !defined(GC_ATOMIC_UNCOLLECTABLE) && defined(ATOMIC_UNCOLLECTABLE) /* For compatibility with old-style naming. */ @@ -259,9 +252,7 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ # include "gc_atomic_ops.h" #endif -#ifndef GC_LOCKS_H -# include "gc_locks.h" -#endif +#include "gc_locks.h" #define GC_WORD_MAX (~(word)0)