chiark / gitweb /
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 34517783bc7685e0be54cd12e9eb0aca5d3f2b25..a6333e97bdc14d0536fb810eb4c067341e6b5593 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 22a8318a108e5a548de15f1cd9776d38d302c251..4a0a19d45203056b7aa0a28f5ba0634082f2b0c6 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 df14fd650f8739d186ac8f81bab377907c6c8c36..7d0b6dd25344e0ae1b7ce35ba7d82d07aa1213ef 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 b7f64f577227a5238cfc72efc475a6719339d5dc..47ca6e291bb2ed38ead873c605cb2d34a740c6b7 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 c6b8fe3f025aee98eb7a439eacfce437bbed94ec..3fee0ea5edd87036e42d9f626e73a9fe31131219 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 75a8eac96dc8d7a956a43dc5bcacf13c9fbbf073..02baef621f51223c4f2cdb7fa1ec0c884e261c42 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 37297940884a9905460718c968a64d3c66a0d7e2..7a7fdb35c49b284d3c16d3848a7de653af831a38 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 ---------------------------------------------------*/