Fixes to compile in Windows C++ compiler

git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@913 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Moises Silva 2009-11-27 20:14:42 +00:00
parent 2c976c9f81
commit 48f2ed527d
2 changed files with 16 additions and 5 deletions

View File

@ -175,6 +175,10 @@
#include "zap_buffer.h"
#include "zap_threadmutex.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __WINDOWS__
#define zap_sleep(x) Sleep(x)
#else
@ -227,7 +231,7 @@
#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)
@ -317,10 +321,6 @@
*/
#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,

View File

@ -405,6 +405,17 @@ typedef enum {
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,