Qpid Proton
  1. Qpid Proton
  2. PROTON-122

Porting Issue -- Visual Studio compilers have different header files

    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:
      None
    • Environment:
      Windows using Visual Studio 10

      Description

      Visual Studio compilers have different header files.

      I looked through the files that qpid cpp uses for including Visual Studio header files.
      It looks like most of the diffences in header files are set up in Boost.
      Boost uses the macro BOOST_WINDOWS.

      Maybe we could use PROTON_WINDOWS for including the windows header files.
      If you don't want a new macro, we can use one of the Visual Studio specific macro (_WINDOWS)
      for the header files.

      It's not really a CPLUSPLUS vs. C issue, since many of the header files are specific to Windows.
      (for example winsock2.h which is used by C++ and C in Visual Studio).
      Also, some of the current header files are not used on Windows, but may be used by CYGWIN or MinGW.

      If this sounds okay, I'll set up a patch for including the necessary windows header files.

        Activity

        Hide
        Cliff Jansen added a comment -

        The boost model was used by boost itself, and was not adopted in qpid cpp.

        The goal has been to separate platform specific code into separate subdirectories (posix, windows, solaris, etc.). Platform neutral code should be free of #ifdefs and macros of the type that you suggest. Platform specific code is free to include anything it needs, again without the need for #ifdefs or special macros.

        This is just a guiding principle. As such, it could be trumped by other factors, but I think you will find that qpid cpp was quite consistent in this regard.

        Given any specific include file that you find missing, you may find that the related problem has already been tackled (and debugged) in the qpid cpp tree. You may find an even closer solution to your proton-specific needs in

        https://issues.apache.org/jira/browse/QPID-4181

        even though the patch was preliminary and the proton code has changed significantly since then. You may also find the comments in the associated review

        https://reviews.apache.org/r/6302/

        to be helpful in understanding the community preferences around structuring the proton code for Windows-specific issues.

        As an aside, this question might have been more appropriately discussed on the dev list, prior to opening a Jira.

        Show
        Cliff Jansen added a comment - The boost model was used by boost itself, and was not adopted in qpid cpp. The goal has been to separate platform specific code into separate subdirectories (posix, windows, solaris, etc.). Platform neutral code should be free of #ifdefs and macros of the type that you suggest. Platform specific code is free to include anything it needs, again without the need for #ifdefs or special macros. This is just a guiding principle. As such, it could be trumped by other factors, but I think you will find that qpid cpp was quite consistent in this regard. Given any specific include file that you find missing, you may find that the related problem has already been tackled (and debugged) in the qpid cpp tree. You may find an even closer solution to your proton-specific needs in https://issues.apache.org/jira/browse/QPID-4181 even though the patch was preliminary and the proton code has changed significantly since then. You may also find the comments in the associated review https://reviews.apache.org/r/6302/ to be helpful in understanding the community preferences around structuring the proton code for Windows-specific issues. As an aside, this question might have been more appropriately discussed on the dev list, prior to opening a Jira.
        Hide
        Cliff Jansen added a comment -

        fixed in PROTON-159

        Show
        Cliff Jansen added a comment - fixed in PROTON-159

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development