]> granicus.if.org Git - gc/commitdiff
Remove redundant header double-inclusion checks in the private headers
authorIvan Maidanski <ivmai@mail.ru>
Tue, 13 Nov 2018 22:24:13 +0000 (01:24 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 13 Nov 2018 22:24:13 +0000 (01:24 +0300)
(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.

include/private/gc_pmark.h
include/private/gc_priv.h

index 5e698f97fb37d29cda966e9b4f04c30b28b21304..3bc3410891fb2150e56a23936e05ce57299049e2 100644 (file)
@@ -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
 
 # 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
 
index 9274d1bcd9af72db81bd133e2f9d0953cbdaecd1..ed45dcda2b97498d4bd05baeeef5f7ac75a06f5b 100644 (file)
 # 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)