di-set.h, ino-map.h: add multiple-inclusion guard
authorJim Meyering <meyering@redhat.com>
Tue, 8 Feb 2011 10:54:05 +0000 (11:54 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 8 Feb 2011 10:54:05 +0000 (11:54 +0100)
Technically, the guard is required only for ino-map.h, due to its
INO_MAP_INSERT_FAILURE definition, but do both for consistency.
* lib/di-set.h: Add file-spanning #ifndef _GL_DI_SET_H.
* lib/ino-map.h: Likewise.

ChangeLog
lib/di-set.h
lib/ino-map.h

index 6fed235..5f306b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-02-08  Jim Meyering  <meyering@redhat.com>
+
+       di-set.h, ino-map.h: add multiple-inclusion guard
+       Technically, the guard is required only for ino-map.h, due to its
+       INO_MAP_INSERT_FAILURE definition, but do both for consistency.
+       * lib/di-set.h: Add file-spanning #ifndef _GL_DI_SET_H.
+       * lib/ino-map.h: Likewise.
+
 2011-02-06  Bruno Haible  <bruno@clisp.org>
 
        iswblank: Ensure declaration on glibc systems.
index f05e876..318e9ae 100644 (file)
@@ -1,14 +1,19 @@
-#include <sys/types.h>
+#ifndef _GL_DI_SET_H
+# define _GL_DI_SET_H
 
-#undef _ATTRIBUTE_NONNULL_
-#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
-# define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m)))
-#else
-# define _ATTRIBUTE_NONNULL_(m)
-#endif
+# include <sys/types.h>
+
+# undef _ATTRIBUTE_NONNULL_
+# if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
+#  define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m)))
+# else
+#  define _ATTRIBUTE_NONNULL_(m)
+# endif
 
 struct di_set *di_set_alloc (void);
 int di_set_insert (struct di_set *, dev_t, ino_t) _ATTRIBUTE_NONNULL_ (1);
 void di_set_free (struct di_set *) _ATTRIBUTE_NONNULL_ (1);
 int di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino)
-  _ATTRIBUTE_NONNULL_ (1);;
+  _ATTRIBUTE_NONNULL_ (1);
+
+#endif
index 661b78a..e060af0 100644 (file)
@@ -1,14 +1,19 @@
-#include <sys/types.h>
+#ifndef _GL_INO_MAP_H
+# define _GL_INO_MAP_H
 
-#undef _ATTRIBUTE_NONNULL_
-#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
-# define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m)))
-#else
-# define _ATTRIBUTE_NONNULL_(m)
-#endif
+# include <sys/types.h>
+
+# undef _ATTRIBUTE_NONNULL_
+# if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
+#  define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m)))
+# else
+#  define _ATTRIBUTE_NONNULL_(m)
+# endif
 
-#define INO_MAP_INSERT_FAILURE ((size_t) -1)
+# define INO_MAP_INSERT_FAILURE ((size_t) -1)
 
 struct ino_map *ino_map_alloc (size_t);
 void ino_map_free (struct ino_map *) _ATTRIBUTE_NONNULL_ (1);
 size_t ino_map_insert (struct ino_map *, ino_t) _ATTRIBUTE_NONNULL_ (1);
+
+#endif