Headers: Guard inclusion of mLib headers.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 3 May 2009 00:40:25 +0000 (01:40 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 20 Oct 2012 11:37:48 +0000 (12:37 +0100)
A number of headers include other mLib headers without #ifndef guards.
This will slow down compilation slightly on some (less sensible)
compilers.

base32.h
base64.h
bres.h
dspool.h
hex.h
sig.h
testrig.h

index 3451778..a6333e9 100644 (file)
--- a/base32.h
+++ b/base32.h
@@ -34,7 +34,9 @@
 
 /*----- Header files ------------------------------------------------------*/
 
-#include "dstr.h"
+#ifndef MLIB_DSTR_H
+#  include "dstr.h"
+#endif
 
 /*----- Data structures ---------------------------------------------------*/
 
index 22a8318..4a0a19d 100644 (file)
--- a/base64.h
+++ b/base64.h
@@ -34,7 +34,9 @@
 
 /*----- Header files ------------------------------------------------------*/
 
-#include "dstr.h"
+#ifndef MLIB_DSTR_H
+#  include "dstr.h"
+#endif
 
 /*----- Data structures ---------------------------------------------------*/
 
diff --git a/bres.h b/bres.h
index df14fd6..7d0b6dd 100644 (file)
--- a/bres.h
+++ b/bres.h
 #  include <adns.h>
 #endif
 
-#include "sel.h"
-#include "selbuf.h"
+#ifndef MLIB_SEL_H
+#  include "sel.h"
+#endif
+
+#ifndef MLIB_SELBUF_H
+#  include "selbuf.h"
+#endif
 
 /*----- Data structures ---------------------------------------------------*/
 
index b7f64f5..47ca6e2 100644 (file)
--- a/dspool.h
+++ b/dspool.h
 
 /*----- Header files ------------------------------------------------------*/
 
-#include "dstr.h"
-#include "sub.h"
+#ifndef MLIB_DSTR_H
+#  include "dstr.h"
+#endif
+
+#ifndef MLIB_SUB_H
+#  include "sub.h"
+#endif
 
 /*----- Data structures ---------------------------------------------------*/
 
diff --git a/hex.h b/hex.h
index c6b8fe3..3fee0ea 100644 (file)
--- a/hex.h
+++ b/hex.h
@@ -34,7 +34,9 @@
 
 /*----- Header files ------------------------------------------------------*/
 
-#include "dstr.h"
+#ifndef MLIB_DSTR_H
+#  include "dstr.h"
+#endif
 
 /*----- Data structures ---------------------------------------------------*/
 
diff --git a/sig.h b/sig.h
index 75a8eac..02baef6 100644 (file)
--- a/sig.h
+++ b/sig.h
@@ -36,7 +36,9 @@
 
 #include <signal.h>
 
-#include "sel.h"
+#ifndef MLIB_SEL_H
+#  include "sel.h"
+#endif
 
 /*----- Data structures ---------------------------------------------------*/
 
index 3729794..7a7fdb3 100644 (file)
--- a/testrig.h
+++ b/testrig.h
 
 #include <stddef.h>
 
-#include "bits.h"
-#include "dstr.h"
+#ifndef MLIB_BITS_H
+#  include "bits.h"
+#endif
+
+#ifndef MLIB_DSTR_H
+#  include "dstr.h"
+#endif
 
 /*----- Magical numbers ---------------------------------------------------*/