compiler.h | compiler.h | |||
---|---|---|---|---|
skipping to change at line 92 | skipping to change at line 92 | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
#define URCU_FORCE_CAST(type, arg) (reinterpret_cast<type>(arg)) | #define URCU_FORCE_CAST(type, arg) (reinterpret_cast<type>(arg)) | |||
#else | #else | |||
#define URCU_FORCE_CAST(type, arg) ((type) (arg)) | #define URCU_FORCE_CAST(type, arg) ((type) (arg)) | |||
#endif | #endif | |||
#define caa_is_signed_type(type) ((type) -1 < (type) 0) | #define caa_is_signed_type(type) ((type) -1 < (type) 0) | |||
/* | /* | |||
* Sign-extend to long if needed, and output type is unsigned long. | * Cast to unsigned long, sign-extending if @v is signed. | |||
* Note: casting to a larger type or to same type size keeps the sign of | ||||
* the expression being cast (see C99 6.3.1.3). | ||||
*/ | */ | |||
#define caa_cast_long_keep_sign(v) \ | #define caa_cast_long_keep_sign(v) ((unsigned long) (v)) | |||
(caa_is_signed_type(__typeof__(v)) ? \ | ||||
(unsigned long) (long) (v) : \ | ||||
(unsigned long) (v)) | ||||
#if defined (__GNUC__) \ | #if defined (__GNUC__) \ | |||
&& ((__GNUC_MAJOR__ == 4) && (__GNUC_MINOR__ >= 5) \ | && ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5) \ | |||
|| __GNUC_MAJOR__ >= 5) | || __GNUC__ >= 5) | |||
#define CDS_DEPRECATED(msg) \ | #define CDS_DEPRECATED(msg) \ | |||
__attribute__((deprecated(msg))) | __attribute__((deprecated(msg))) | |||
#else | #else | |||
#define CDS_DEPRECATED(msg) \ | #define CDS_DEPRECATED(msg) \ | |||
__attribute__((deprecated)) | __attribute__((deprecated)) | |||
#endif | #endif | |||
#define CAA_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | #define CAA_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | |||
/* | /* | |||
End of changes. 3 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
lfstack.h | lfstack.h | |||
---|---|---|---|---|
skipping to change at line 84 | skipping to change at line 84 | |||
struct cds_lfs_head *head; | struct cds_lfs_head *head; | |||
pthread_mutex_t lock; | pthread_mutex_t lock; | |||
}; | }; | |||
#ifdef _LGPL_SOURCE | #ifdef _LGPL_SOURCE | |||
#include <urcu/static/lfstack.h> | #include <urcu/static/lfstack.h> | |||
#define cds_lfs_node_init _cds_lfs_node_init | #define cds_lfs_node_init _cds_lfs_node_init | |||
#define cds_lfs_init _cds_lfs_init | #define cds_lfs_init _cds_lfs_init | |||
#define __cds_lfs_init ___cds_lfs_init | ||||
#define cds_lfs_empty _cds_lfs_empty | #define cds_lfs_empty _cds_lfs_empty | |||
#define cds_lfs_push _cds_lfs_push | #define cds_lfs_push _cds_lfs_push | |||
/* Locking performed internally */ | /* Locking performed internally */ | |||
#define cds_lfs_pop_blocking _cds_lfs_pop_blocking | #define cds_lfs_pop_blocking _cds_lfs_pop_blocking | |||
#define cds_lfs_pop_all_blocking _cds_lfs_pop_all_blocking | #define cds_lfs_pop_all_blocking _cds_lfs_pop_all_blocking | |||
/* Synchronize pop with internal mutex */ | /* Synchronize pop with internal mutex */ | |||
#define cds_lfs_pop_lock _cds_lfs_pop_lock | #define cds_lfs_pop_lock _cds_lfs_pop_lock | |||
#define cds_lfs_pop_unlock _cds_lfs_pop_unlock | #define cds_lfs_pop_unlock _cds_lfs_pop_unlock | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||