]> 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>
Mon, 26 Nov 2018 06:39:40 +0000 (09:39 +0300)
(a cherry-pick of commits 4f837f7a7a72365dad from 'master')

* include/private/gc_pmark.h [HAVE_CONFIG_H && !GC_PRIVATE_H]: Add
comment.
* 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 6def385bc44695cf2a1d8345a02529cceec717b2..fa425cdd032b7374bb08abc4601b5a6c6ffca6ef 100644 (file)
@@ -23,6 +23,8 @@
 #define GC_PMARK_H
 
 #if defined(HAVE_CONFIG_H) && !defined(GC_PRIVATE_H)
+  /* When gc_pmark.h is included from gc_priv.h, some of macros might   */
+  /* be undefined in gcconfig.h, so skip config.h in this case.         */
 # 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 31d180e36e966aa1008e453e9d42354567d19d37..e4e07181715483eb1b13e3b64bb0f96bb3f187c3 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)