[ https://issues.apache.org/jira/browse/PROTON-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501294#comment-13501294 ]
Mary hinton commented on PROTON-148: ------------------------------------ Patch is attached. It can also be viewed here. https://github.com/MaryDHinton/qpid-proton/compare/protonWin > Porting Issue -- Visual Studio requires an explicit cast inside the resize > macros > --------------------------------------------------------------------------------- > > Key: PROTON-148 > URL: https://issues.apache.org/jira/browse/PROTON-148 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c > Environment: WIndows using Visual Studio 2010 > Reporter: Mary hinton > Labels: build > Attachments: PN_ENSURE.patch > > > The PN_ENSURE and PN_ENSUREZ macros do not compile using Visual Studio > toolset. > Suggest changing the macros to the following for both ports: > #define PN_ENSURE(ARRAY, CAPACITY, COUNT, PNTYPE) \ > while ((CAPACITY) < (COUNT)) { \ > (CAPACITY) = (CAPACITY) ? 2 * (CAPACITY) : 16; \ > (ARRAY) = (PNTYPE) realloc((ARRAY), (CAPACITY) * sizeof (*(ARRAY))); \ > } > #define PN_ENSUREZ(ARRAY, CAPACITY, COUNT, PNTYPE) \ > { \ > size_t _old_capacity = (CAPACITY); \ > PN_ENSURE((ARRAY), (CAPACITY), (COUNT), PNTYPE); \ > memset((ARRAY) + _old_capacity, 0, \ > sizeof(*(ARRAY))*((CAPACITY) - _old_capacity)); \ > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira