bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] di-set.h, ino-map.h: add multiple-inclusion guard


From: Jim Meyering
Subject: [PATCH] di-set.h, ino-map.h: add multiple-inclusion guard
Date: Tue, 08 Feb 2011 11:54:43 +0100

I've added #ifndef guards:

>From d9f5da66f7c95f84b6b28b17cfa4c5248ad2b591 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 8 Feb 2011 11:54:05 +0100
Subject: [PATCH] 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.
---
 ChangeLog     |    8 ++++++++
 lib/di-set.h  |   21 +++++++++++++--------
 lib/ino-map.h |   21 +++++++++++++--------
 3 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6fed235..5f306b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-02-08  Jim Meyering  <address@hidden>
+
+       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  <address@hidden>

        iswblank: Ensure declaration on glibc systems.
diff --git a/lib/di-set.h b/lib/di-set.h
index f05e876..318e9ae 100644
--- 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

-#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
diff --git a/lib/ino-map.h b/lib/ino-map.h
index 661b78a..e060af0 100644
--- 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

-#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
--
1.7.4.2.g597a6



reply via email to

[Prev in Thread] Current Thread [Next in Thread]