Qpid Proton
  1. Qpid Proton
  2. PROTON-67

Porting Issue -- Initialization with braces is not supported by Visual Studio.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4
    • Component/s: proton-c
    • Labels:
    • Environment:
      Windows using Visual Studio 2010

      Description

      In the Windows port, I used ifdef(s) for the initializations to keep the current code for Linux, and added code to compile in Visual Studio. If there is no objection, maybe we could replace the current initialization code with the Visual Studio code and remove the #ifdef(s).
      Here's some examples:

      Eample1

      ssize_t pn_data_encode(pn_data_t *data, char *bytes, size_t size)
      {
      #ifndef _WINDOWS
      pn_atoms_t latoms =

      {.size=data->size + data->extras, .start=atoms}

      ;
      #else
      pn_atoms_t latoms;
      latoms.size = data->size + data->extras;
      latoms.start = atoms;
      #endif

      --------------------
      Example 2

      #ifndef _WINDOWS
      return (pn_bytes_t)

      {size, start}

      ;
      #else
      pn_bytes_t pnBytes;
      pnBytes.size = size;
      pnBytes.start= start;
      return pnBytes;
      #endif
      --------------------
      Example 3

      pn_do_transfer()

      #ifndef _WINDOWS
      delivery = pn_delivery(link, pn_dtag(tag.start, tag.size));
      #else
      pn_delivery_tag_t delivt;
      delivt.bytes = tag.start;
      delivt.size = tag.size;
      delivery = pn_delivery(link, delivt);
      #endif

        Activity

        Mary hinton created issue -
        Rafael H. Schloming made changes -
        Field Original Value New Value
        Fix Version/s 0.4 [ 12324003 ]
        Rafael H. Schloming made changes -
        Assignee Cliff Jansen [ cliffjansen ]
        Cliff Jansen made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Cliff Jansen
            Reporter:
            Mary hinton
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development