ck_cc: Add DECONST_PTR and RESTRICT.

DECONST_PTR is a hack to deconstify void pointer values
that is safe in presence of -Wcast-qual. CK_CC_RESTRICT
is restrict qualifier that can be disabled for only
partially C99 compliant compilers.
ck_pring
Samy Al Bahra 10 years ago
parent 56b25beecb
commit b8be614461

@ -32,6 +32,12 @@
#include "gcc/ck_cc.h" #include "gcc/ck_cc.h"
#endif #endif
#ifndef CK_CC_RESTRICT
#define CK_CC_RESTRICT
#endif
#define CK_CC_DECONST_PTR(X) ((void *)(uintptr_t)(X))
/* /*
* Container function. * Container function.
* This relies on (compiler) implementation-defined behavior. * This relies on (compiler) implementation-defined behavior.

@ -57,6 +57,8 @@
#define CK_CC_INLINE CK_CC_UNUSED #define CK_CC_INLINE CK_CC_UNUSED
#endif #endif
#define CK_CC_RESTRICT restrict
/* /*
* Packed attribute. * Packed attribute.
*/ */

Loading…
Cancel
Save