Browse Source

define __pure and __const

tags/v0.9.3
Holger Lubitz 17 years ago
parent
commit
e8b8991b84
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      src/include/compiler.h

+ 12
- 0
src/include/compiler.h View File

@@ -279,6 +279,18 @@ extern void dbg_hex_dump_da ( unsigned long dispaddr,
279 279
 /** Apply standard C calling conventions */
280 280
 #define __cdecl __attribute__ (( cdecl , regparm(0) ))
281 281
 
282
+/**
283
+ * Declare a function as pure - i.e. without side effects
284
+ */
285
+#define __pure __attribute__ (( pure ))
286
+
287
+/**
288
+ * Declare a function as const - i.e. it does not access global memory
289
+ * (including dereferencing pointers passed to it) at all.
290
+ * Must also not call any non-const functions.
291
+ */
292
+#define __const __attribute__ (( const ))
293
+
282 294
 /**
283 295
  * Declare a function as used.
284 296
  *

Loading…
Cancel
Save