From e8b8991b84e97a49f587d803e1e4b55d76332464 Mon Sep 17 00:00:00 2001 From: Holger Lubitz Date: Thu, 2 Aug 2007 00:27:54 +0200 Subject: [PATCH] define __pure and __const --- src/include/compiler.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/include/compiler.h b/src/include/compiler.h index 2151fc6a..8d76ac47 100644 --- a/src/include/compiler.h +++ b/src/include/compiler.h @@ -279,6 +279,18 @@ extern void dbg_hex_dump_da ( unsigned long dispaddr, /** Apply standard C calling conventions */ #define __cdecl __attribute__ (( cdecl , regparm(0) )) +/** + * Declare a function as pure - i.e. without side effects + */ +#define __pure __attribute__ (( pure )) + +/** + * Declare a function as const - i.e. it does not access global memory + * (including dereferencing pointers passed to it) at all. + * Must also not call any non-const functions. + */ +#define __const __attribute__ (( const )) + /** * Declare a function as used. *