you need to include first. You don't need to include any files
other than the usual config.h.
Include <inttypes.h> and <stdint.h> if available, for uintmax_t.
Remove 'struct stat;' not needed since we know sys/stat.h has
been included by dev-ino.h.
(struct cycle_check_state): Change chdir_counter to uintmax_t,
not size_t, since it isn't limited by object sizes.
Change magic from long unsigned int to int; that's good enough
for our use.
#ifndef CYCLE_CHECK_H
# define CYCLE_CHECK_H 1
-/* Before including this file, you need something like the following:
-
- #if HAVE_CONFIG_H
- # include <config.h>
- #endif
-
- #include <sys/types.h>
- #include <sys/stat.h>
-
- #include <stdbool.h>
-
- so that the proper identifiers are all declared. */
-
+# if HAVE_INTTYPES_H
+# include <inttypes.h>
+# endif
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
# include <stdbool.h>
# include "dev-ino.h"
-struct stat;
-
struct cycle_check_state
{
struct dev_ino dev_ino;
- size_t chdir_counter;
- long unsigned int magic;
+ uintmax_t chdir_counter;
+ int magic;
};
void cycle_check_init (struct cycle_check_state *state);