Qpid
  1. Qpid
  2. QPID-2475

qpid/messaging/Session.h r928855 breaks Windows build - macro conflict

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.7
    • Component/s: C++ Client
    • Labels:
      None
    • Environment:

      Windows

      Description

      this change broke on Windows:

      Index: C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h
      ===================================================================
      — C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h (revision 928854)
      +++ C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h (revision 928855)
      @@ -102,7 +102,7 @@

      • which case the passed in receiver reference will be set to the
      • receiver for that message or false if no message was available.
        */
      • QPID_CLIENT_EXTERN bool nextReceiver(Receiver&, Duration timeout=INFINITE_DURATION);
        + QPID_CLIENT_EXTERN bool nextReceiver(Receiver&, Duration timeout=Duration::INFINITE);
        /**
      • Returns the receiver for the next available message. If there
      • are no available messages at present the call will block for up
        @@ -111,7 +111,7 @@
        *@exception Receiver::NoMessageAvailable if no message became available in
      • time.
        */
      • QPID_CLIENT_EXTERN Receiver nextReceiver(Duration timeout=INFINITE_DURATION);
        + QPID_CLIENT_EXTERN Receiver nextReceiver(Duration timeout=Duration::INFINITE);

      /**

      • Create a new sender through which messages can be sent to the

      These errors occur during compile:

      C:\qpid\trunk\qpid\cpp\include\qpid/messaging/Session.h(105) : error C2589: 'constant' : illegal token on right side of '::'
      C:\qpid\trunk\qpid\cpp\include\qpid/messaging/Session.h(114) : error C2589: 'constant' : illegal token on right side of '::'

      Because of this definition in the Windows SDK:

      #define INFINITE 0xFFFFFFFF // Infinite timeout

      Can Duration::INFINITE, although a very good name, change to something like BOUNDLESS?

        Activity

        Steve Huston created issue -
        Steve Huston made changes -
        Field Original Value New Value
        Description this change broke on Windows:

        Index: C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h
        ===================================================================
        --- C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h (revision 928854)
        +++ C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h (revision 928855)
        @@ -102,7 +102,7 @@
              * which case the passed in receiver reference will be set to the
              * receiver for that message or false if no message was available.
              */
        - QPID_CLIENT_EXTERN bool nextReceiver(Receiver&, Duration timeout=INFINITE_DURATION);
        + QPID_CLIENT_EXTERN bool nextReceiver(Receiver&, Duration timeout=Duration::INFINITE);
             /**
              * Returns the receiver for the next available message. If there
              * are no available messages at present the call will block for up
        @@ -111,7 +111,7 @@
              *@exception Receiver::NoMessageAvailable if no message became available in
              * time.
              */
        - QPID_CLIENT_EXTERN Receiver nextReceiver(Duration timeout=INFINITE_DURATION);
        + QPID_CLIENT_EXTERN Receiver nextReceiver(Duration timeout=Duration::INFINITE);
             
             /**
              * Create a new sender through which messages can be sent to the

        Apparantly INFINITE is a macro brought in somewhere in Windows:

        C:\qpid\trunk\qpid\cpp\include\qpid/messaging/Session.h(105) : error C2589: 'constant' : illegal token on right side of '::'
        C:\qpid\trunk\qpid\cpp\include\qpid/messaging/Session.h(114) : error C2589: 'constant' : illegal token on right side of '::'
        this change broke on Windows:

        Index: C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h
        ===================================================================
        --- C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h (revision 928854)
        +++ C:/qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h (revision 928855)
        @@ -102,7 +102,7 @@
              * which case the passed in receiver reference will be set to the
              * receiver for that message or false if no message was available.
              */
        - QPID_CLIENT_EXTERN bool nextReceiver(Receiver&, Duration timeout=INFINITE_DURATION);
        + QPID_CLIENT_EXTERN bool nextReceiver(Receiver&, Duration timeout=Duration::INFINITE);
             /**
              * Returns the receiver for the next available message. If there
              * are no available messages at present the call will block for up
        @@ -111,7 +111,7 @@
              *@exception Receiver::NoMessageAvailable if no message became available in
              * time.
              */
        - QPID_CLIENT_EXTERN Receiver nextReceiver(Duration timeout=INFINITE_DURATION);
        + QPID_CLIENT_EXTERN Receiver nextReceiver(Duration timeout=Duration::INFINITE);
             
             /**
              * Create a new sender through which messages can be sent to the

        These errors occur during compile:

        C:\qpid\trunk\qpid\cpp\include\qpid/messaging/Session.h(105) : error C2589: 'constant' : illegal token on right side of '::'
        C:\qpid\trunk\qpid\cpp\include\qpid/messaging/Session.h(114) : error C2589: 'constant' : illegal token on right side of '::'

        Because of this definition in the Windows SDK:

        #define INFINITE 0xFFFFFFFF // Infinite timeout


        Can Duration::INFINITE, although a very good name, change to something like BOUNDLESS?
        Hide
        Gordon Sim added a comment -

        Sorry! We can certainly change it. I'm not mad on BOUNDLESS - how about FOREVER? Or could we use camel case rather than pure caps for these constants?

        Show
        Gordon Sim added a comment - Sorry! We can certainly change it. I'm not mad on BOUNDLESS - how about FOREVER? Or could we use camel case rather than pure caps for these constants?
        Hide
        Steve Huston added a comment -

        I like FOREVER better too. I'll change it. Thanks Gordon!

        Show
        Steve Huston added a comment - I like FOREVER better too. I'll change it. Thanks Gordon!
        Steve Huston made changes -
        Assignee Steve Huston [ shuston ]
        Hide
        Steve Huston added a comment -

        Fixed on trunk r929240.

        Show
        Steve Huston added a comment - Fixed on trunk r929240.
        Steve Huston made changes -
        Fix Version/s 0.7 [ 12314455 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Justin Ross made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Steve Huston
            Reporter:
            Steve Huston
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development