#define PERROR(call, args...) \
do { \
if (ust_err_debug_enabled()) { \
- char buf[200] = "Error in strerror_r()"; \
- strerror_r(errno, buf, sizeof(buf)); \
- ERRMSG("Error: " call ": %s", ## args, buf); \
+ char perror_buf[200] = "Error in strerror_r()"; \
+ strerror_r(errno, perror_buf, \
+ sizeof(perror_buf)); \
+ ERRMSG("Error: " call ": %s", ## args, \
+ perror_buf); \
} \
} while(0)
#else
#define PERROR(call, args...) \
do { \
if (ust_err_debug_enabled()) { \
- char *buf; \
- char tmp[200]; \
- buf = strerror_r(errno, tmp, sizeof(tmp)); \
- ERRMSG("Error: " call ": %s", ## args, buf); \
+ char *perror_buf; \
+ char perror_tmp[200]; \
+ perror_buf = strerror_r(errno, perror_tmp, \
+ sizeof(perror_tmp)); \
+ ERRMSG("Error: " call ": %s", ## args, \
+ perror_buf); \
} \
} while(0)
#endif
return &obj->memory_map[ref_offset];
}
-#define shmp_index(handle, ref, index) \
- ({ \
- __typeof__((ref)._type) ____ptr_ret; \
- ____ptr_ret = (__typeof__(____ptr_ret)) _shmp_offset((handle)->table, &(ref)._ref, index, sizeof(*____ptr_ret)); \
- ____ptr_ret; \
- })
+#define shmp_index(handle, ref, index) \
+ ((__typeof__((ref)._type)) _shmp_offset((handle)->table, &(ref)._ref, index, sizeof(*((ref)._type))))
#define shmp(handle, ref) shmp_index(handle, ref, 0)