Thrift
  1. Thrift
  2. THRIFT-762

Cocoa library won't compile on Mac OS X

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: 0.2, 0.3
    • Fix Version/s: None
    • Component/s: Cocoa - Library
    • Labels:
      None
    • Environment:

      Mac OS X Snow Leopard 10.6, Mac OS X Leopard 10.5

    • Patch Info:
      Patch Available

      Description

      The cocoa library will not compile for Objective-C Cocoa applications on Mac OS X because it tries to include <CFNetwork/CFSocketStream.h> in transport/TSocketClient.m. This should be a pound-define that includes <CoreServices/CoreServices.h> if being compiled on Mac OS X or <CFNetwork/CFNetwork.h> if being compiled for iPhone OS.

      Also, the Mac OS X build will give a warning because the NSStreamDelegate protocol is not implemented in transport/TNSStreamTransport.

      {h,m}

      I have attached a patch to fix both issues.

      1. build_on_osx.patch
        2 kB
        Jeremy Fergason

        Activity

        Hide
        Bryan Duxbury added a comment -

        I applied this patch and it looks ok... but can you tell me how to actually verify it works? I've never built the cocoa library.

        Show
        Bryan Duxbury added a comment - I applied this patch and it looks ok... but can you tell me how to actually verify it works? I've never built the cocoa library.
        Hide
        Andrew McGeachie added a comment -

        I've applied the portion of this patch that deals with <CFNetwork/CFSocketStream.h> import in TSocketClient.m

        The other part of the patch, dealing with NSStreamDelegate protocol causes an error when compiling against the 10.5 SDK since NSStreamDelegate is defined in SDK 10.6 and later. 10.5 is out minimum required target.

        So I figure our options are:

        a) add another #if for compiling on 10.5 vs. 10.6

        b) wait for the problem to go away when we get a Framework for the cocoa runtime made.

        c) something else?

        Thoughts?

        Show
        Andrew McGeachie added a comment - I've applied the portion of this patch that deals with <CFNetwork/CFSocketStream.h> import in TSocketClient.m The other part of the patch, dealing with NSStreamDelegate protocol causes an error when compiling against the 10.5 SDK since NSStreamDelegate is defined in SDK 10.6 and later. 10.5 is out minimum required target. So I figure our options are: a) add another #if for compiling on 10.5 vs. 10.6 b) wait for the problem to go away when we get a Framework for the cocoa runtime made. c) something else? Thoughts?
        Hide
        Jake Farrell added a comment -

        Hey Andrew, I would just go with 10.6 but there is all ready checks in place for NSStreamDelegate, see transport/TSocketClient.h so use a similar approach. I will help with making a framework, will create a separate ticket for it

        Show
        Jake Farrell added a comment - Hey Andrew, I would just go with 10.6 but there is all ready checks in place for NSStreamDelegate, see transport/TSocketClient.h so use a similar approach. I will help with making a framework, will create a separate ticket for it
        Hide
        Jake Farrell added a comment -

        Library has been tested and works with 10.6, closing as lib maintains compatibility with latest sdk

        Show
        Jake Farrell added a comment - Library has been tested and works with 10.6, closing as lib maintains compatibility with latest sdk

          People

          • Assignee:
            Andrew McGeachie
            Reporter:
            Jeremy Fergason
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development