开源代码中看到的一个使用方便的宏定义

宏定义:

#define TEST_FAIL(C,R) if (!C) { R = false; }

 

宏使用:

 bool saveAllOk = true;

 // option "use_encoding_1" have need for compatible with old-vnc files
 TEST_FAIL(sm->setBoolean(_T("use_encoding_1"),   m_allowedCopyRect), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("copyrect"),         m_allowedCopyRect), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("viewonly"),         m_viewOnly), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("fullscreen"),       m_useFullscreen), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("8bit"),             m_use8BitColor), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("shared"),           m_requestSharedSession), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("belldeiconify"),    m_deiconifyOnRemoteBell), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("disableclipboard"), !m_isClipboardEnabled), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("swapmouse"),        m_swapMouse), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("fitwindow"),        m_fitWindow), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("cursorshape"),      m_requestShapeUpdates), saveAllOk);
 TEST_FAIL(sm->setBoolean(_T("noremotecursor"),   m_ignoreShapeUpdates), saveAllOk);

 TEST_FAIL(sm->setByte(_T("preferred_encoding"),  m_preferredEncoding), saveAllOk);
 TEST_FAIL(sm->setInt(_T("compresslevel"),        m_customCompressionLevel), saveAllOk);
 TEST_FAIL(sm->setInt(_T("quality"),              m_jpegCompressionLevel), saveAllOk);
 TEST_FAIL(sm->setInt(_T("localcursor"),          m_localCursor), saveAllOk);
 TEST_FAIL(sm->setInt(_T("scale_den"),            m_scaleDenominator), saveAllOk);
 TEST_FAIL(sm->setInt(_T("scale_num"),            m_scaleNumerator), saveAllOk);

 TEST_FAIL(sm->setInt(_T("local_cursor_shape"),   m_localCursor), saveAllOk);

 

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值