From 3db2ec5e22534f3da76861303cd9daf644bee95a Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Thu, 9 Jul 2009 17:01:30 +0200 Subject: [PATCH] Added macros that can possibly make it easier to optimize functions using forced inlining and regparm. --- src/uhub.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/uhub.h b/src/uhub.h index d96557c..fd812e8 100644 --- a/src/uhub.h +++ b/src/uhub.h @@ -25,6 +25,23 @@ /* #define MEMORY_DEBUG */ /* #define DEBUG_SENDQ 1 */ +#if USE_REGPARM && __GNUC__ >= 3 +#define REGPRM1 __attribute__((regparm(1))) +#define REGPRM2 __attribute__((regparm(2))) +#define REGPRM3 __attribute__((regparm(3))) +#else +#define REGPRM1 +#define REGPRM2 +#define REGPRM3 +#endif + +#ifndef FORCEINLINE +#if __GNUC__ < 3 +#define FORCEINLINE inline +#else +#define FORCEINLINE inline __attribute__((always_inline)) +#endif +#endif #ifndef _GNU_SOURCE