diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..e339b40 --- /dev/null +++ b/src/common.h @@ -0,0 +1,35 @@ +/* + * This file is part of linux-steam-integration. + * + * Copyright © 2016-2017 Ikey Doherty + * + * linux-steam-integration is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + */ + +#pragma once + +#define _GNU_SOURCE + +/* Mark a variable/argument as unused to skip warnings */ +#define __lsi_unused__ __attribute__((unused)) + +/* Force inlining of a function */ +#define __lsi_inline__ __attribute__((always_inline)) + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) + +/* + * Editor modelines - https://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=8 tabstop=8 expandtab: + * :indentSize=8:tabSize=8:noTabs=true: + */ diff --git a/src/intercept/main.c b/src/intercept/main.c index e73e174..d2a4784 100644 --- a/src/intercept/main.c +++ b/src/intercept/main.c @@ -11,13 +11,13 @@ #define _GNU_SOURCE -#include "../shim/lsi.h" -#include "nica/nica.h" - #include #include #include +#include "../common.h" +#include "nica/nica.h" + /** * Is this a process we're actually interested in? */ diff --git a/src/shim/lsi.h b/src/shim/lsi.h index 87097e3..2d4da34 100644 --- a/src/shim/lsi.h +++ b/src/shim/lsi.h @@ -20,16 +20,9 @@ #include #include +#include "../common.h" #include "config.h" -/* Mark a variable/argument as unused to skip warnings */ -#define __lsi_unused__ __attribute__((unused)) - -/* Force inlining of a function */ -#define __lsi_inline__ __attribute__((always_inline)) - -#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) - /** * Current Linux Steam Integration settings. */