diff --git a/include/util.h b/include/util.h index 5d42b7806..8e65e6d61 100644 --- a/include/util.h +++ b/include/util.h @@ -1,4 +1,9 @@ +#ifndef _SWAY_UTIL_H +#define _SWAY_UTIL_H + /** * Wrap i into the range [0, max[ */ int wrap(int i, int max); + +#endif diff --git a/sway/util.c b/sway/util.c index 25aeb9f43..9a59ddf91 100644 --- a/sway/util.c +++ b/sway/util.c @@ -1,3 +1,5 @@ +#include "util.h" + int wrap(int i, int max) { return ((i % max) + max) % max; }