#include "zap_buffer.h"
#include "zap_threadmutex.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef __WINDOWS__
#define zap_sleep(x) Sleep(x)
#else
#define zap_set_flag(obj, flag) (obj)->flags |= (flag)
#define zap_set_flag_locked(obj, flag) assert(obj->mutex != NULL); \
zap_mutex_lock(obj->mutex); \
- (obj)->flags |= (flag); \
+ (obj)->flags |= (flag); \
zap_mutex_unlock(obj->mutex);
#define zap_set_pflag(obj, flag) (obj)->pflags |= (flag)
*/
#define zap_copy_flags(dest, src, flags) (dest)->flags &= ~(flags); (dest)->flags |= ((src)->flags & (flags))
-#ifdef __cplusplus
-extern "C" {
-#endif
-
typedef enum {
ZAP_STATE_CHANGE_FAIL,
ZAP_STATE_CHANGE_SUCCESS,
ZAP_CHANNEL_ANSWERED = (1 << 23),
ZAP_CHANNEL_MUTE = (1 << 24)
} zap_channel_flag_t;
+#if defined(__cplusplus) && defined(WIN32)
+ // fix C2676
+__inline__ zap_channel_flag_t operator|=(zap_channel_flag_t a, int32_t b) {
+ a = (zap_channel_flag_t)(a | b);
+ return a;
+}
+__inline__ zap_channel_flag_t operator&=(zap_channel_flag_t a, int32_t b) {
+ a = (zap_channel_flag_t)(a & b);
+ return a;
+}
+#endif
typedef enum {
ZSM_NONE,