Results 1 to 6 of 6

Thread: Obj-C Mapping

  1. #1
    slypete's Avatar
    slypete is offline Registered User
    Name: Pete Sylvester
    Organization: Coconaut Studios
    Project: iPhone/iPod Game
    Join Date
    Feb 2008
    Posts
    74

    Obj-C Mapping

    This simple slice module:
    Code:
    module Datatypes
    {
    
    struct Vector2D
    {
    	double x;
    	double y;
    };
    
    };
    Produces this Obj-C method:
    Code:
    -(NSUInteger) hash
    {
        NSUInteger h_ = 0;
        h_ = (h_ << 1) ^ x;
        h_ = (h_ << 1) ^ y;
        return h_;
    }
    Which yields two identical syntax errors:
    Code:
    error: invalid operands to binary ^

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    Thanks for the bug report! We're looking into this and we'll let you know once we have a fix.

    Cheers,
    Benoit.

  3. #3
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    I've posted a patch for this bug on this thread. Thanks again for the report!

    Cheers,
    Benoit.

  4. #4
    slypete's Avatar
    slypete is offline Registered User
    Name: Pete Sylvester
    Organization: Coconaut Studios
    Project: iPhone/iPod Game
    Join Date
    Feb 2008
    Posts
    74
    Hi Benoit,

    When I try to build IceTouch after applying the patch:
    Code:
    Test.m: In function ‘-[TestOperationsStruct2 hash]’:
    Test.m:331: error: invalid operands to binary ^
    Test.m:332: error: invalid operands to binary ^
    make[4]: *** [Test.o] Error 1
    make[3]: *** [all] Error 1
    make[2]: *** [all] Error 1
    make[1]: *** [all] Error 1
    make: *** [all] Error 1
    I can build the same directory just fine without the patch.

    Thanks,
    Pete

  5. #5
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi Pete,

    Sorry, I should have mentioned that rebuilding the slice2objc translator is necessary after applying the patch. To rebuild the translator:

    Code:
      $ cd IceTouch-0.1.0/cpp
      $ make
    Note that you also need to build and install mcpp (you can use the latest version, 2.7.2) to build the translators. For instructions on how to build mcpp see the INSTALL file at the top-level of your Ice Touch distribution.

    Cheers,
    Benoit.

  6. #6
    slypete's Avatar
    slypete is offline Registered User
    Name: Pete Sylvester
    Organization: Coconaut Studios
    Project: iPhone/iPod Game
    Join Date
    Feb 2008
    Posts
    74
    Hi Benoit,

    I tried that after the entire build failed, but I had forgotten about the mcpp dependency that I read about a while back. I'm all set now!

    Thanks a lot for the quick fix,
    Pete

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Future of the Obj-C Mapping
    By lastkevin in forum Comments
    Replies: 3
    Last Post: 06-17-2010, 04:09 AM
  2. Freeze::ConnectionPtr from Freeze::Map Obj
    By paolo in forum Comments
    Replies: 1
    Last Post: 01-05-2008, 05:02 PM
  3. Ice and Applescript on OS/X (C++ vs Obj-C)?
    By lancepw in forum Help Center
    Replies: 1
    Last Post: 12-01-2006, 03:09 AM
  4. C mapping
    By colding in forum Comments
    Replies: 4
    Last Post: 03-31-2005, 04:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •