From: Jim Meyering Date: Tue, 8 Feb 2011 10:54:05 +0000 (+0100) Subject: di-set.h, ino-map.h: add multiple-inclusion guard X-Git-Tag: v0.1~3211 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=d9f5da66f7c95f84b6b28b17cfa4c5248ad2b591;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 6fed235d5..5f306b017 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-02-08 Jim Meyering + + 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 iswblank: Ensure declaration on glibc systems. diff --git a/lib/di-set.h b/lib/di-set.h index f05e8760c..318e9aec1 100644 --- a/lib/di-set.h +++ b/lib/di-set.h @@ -1,14 +1,19 @@ -#include +#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 + +# 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 661b78a55..e060af024 100644 --- a/lib/ino-map.h +++ b/lib/ino-map.h @@ -1,14 +1,19 @@ -#include +#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 + +# 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