From 4e6f47368bb10c552a4a2725a09f468759eba523 Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Thu, 26 May 2016 21:45:58 +0100 Subject: [PATCH] Make the 64-bit detection static inline Signed-off-by: Ikey Doherty --- src/lsi.c | 9 --------- src/lsi.h | 13 ++++++++++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lsi.c b/src/lsi.c index 2c6c81f..591b9a0 100644 --- a/src/lsi.c +++ b/src/lsi.c @@ -9,19 +9,10 @@ * of the License, or (at your option) any later version. */ -#include #include #include "lsi.h" -bool lsi_system_is_64bit(void) -{ -#if UINTPTR_MAX == 0xffffffffffffffff - return true; -#endif - return false; -} - bool lsi_config_load(__lsi_unused__ LsiConfig *config) { fputs("lsi_config_load(): Not yet implemented", stderr); diff --git a/src/lsi.h b/src/lsi.h index 8bda125..371a668 100644 --- a/src/lsi.h +++ b/src/lsi.h @@ -12,10 +12,13 @@ #pragma once #include +#include /* 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)) /** * Current Linux Steam Integration settings. */ @@ -40,8 +43,16 @@ bool lsi_config_store(LsiConfig *config); /** * Determine if the host system is 64-bit. + * + * @returns true if 64-bit, otherwise false */ -bool lsi_system_is_64bit(void); +__lsi_inline__ static inline bool lsi_system_is_64bit(void) +{ +#if UINTPTR_MAX == 0xffffffffffffffff + return true; +#endif + return false; +} /* * Editor modelines - https://www.wireshark.org/tools/modelines.html