Преглед изворни кода

define __pure and __const

tags/v0.9.3
Holger Lubitz пре 17 година
родитељ
комит
cd619a1eec
1 измењених фајлова са 12 додато и 0 уклоњено
  1. 12
    0
      src/include/compiler.h

+ 12
- 0
src/include/compiler.h Прегледај датотеку

279
 /** Apply standard C calling conventions */
279
 /** Apply standard C calling conventions */
280
 #define __cdecl __attribute__ (( cdecl , regparm(0) ))
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
  * Declare a function as used.
295
  * Declare a function as used.
284
  *
296
  *

Loading…
Откажи
Сачувај