changeset 14312:e8b52e48a3ab

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.
author Jim Meyering <meyering@redhat.com>
date Tue, 08 Feb 2011 11:54:05 +0100
parents fca8886d4520
children dd51e283d6cd
files ChangeLog lib/di-set.h lib/ino-map.h
diffstat 3 files changed, 34 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/lib/di-set.h
+++ b/lib/di-set.h
@@ -1,14 +1,19 @@
-#include <sys/types.h>
+#ifndef _GL_DI_SET_H
+# define _GL_DI_SET_H
+
+# 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
+# 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
--- a/lib/ino-map.h
+++ b/lib/ino-map.h
@@ -1,14 +1,19 @@
-#include <sys/types.h>
+#ifndef _GL_INO_MAP_H
+# define _GL_INO_MAP_H
+
+# 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
+# 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