Archived

This forum has been archived. Please start a new discussion on GitHub.

Obj-C Mapping

This simple slice module:
module Datatypes
{

struct Vector2D
{
	double x;
	double y;
};

};

Produces this Obj-C method:
-(NSUInteger) hash
{
    NSUInteger h_ = 0;
    h_ = (h_ << 1) ^ x;
    h_ = (h_ << 1) ^ y;
    return h_;
}

Which yields two identical syntax errors:
error: invalid operands to binary ^

Comments

  • benoit
    benoit Rennes, France
    Hi,

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

    Cheers,
    Benoit.
  • benoit
    benoit Rennes, France
    I've posted a patch for this bug on this thread. Thanks again for the report!

    Cheers,
    Benoit.
  • Hi Benoit,

    When I try to build IceTouch after applying the patch:
    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
  • benoit
    benoit Rennes, France
    Hi Pete,

    Sorry, I should have mentioned that rebuilding the slice2objc translator is necessary after applying the patch. To rebuild the translator:
      $ 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.
  • 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