Giter VIP home page Giter VIP logo

Comments (4)

PeqNP avatar PeqNP commented on July 17, 2024

Hmm... even more interesting. I moved all of the code from the CustomMatchers.h file into the CedarComparators.h file, between the #ifdef CEDAR_CUSTOM_COMPARATORS guard, and I'm getting the same errors. I can safely remove the possibility of the CustomMatchers.h header file being the source of the issue.

from cedar.

briancroom avatar briancroom commented on July 17, 2024

Hey @PeqNP, I think I have an idea why you're experiencing this. With recent Cedar versions, Xcode tries to also build a Swift-compatible "module" version of Cedar, which can only include non-C++ components. This change means that all matchers (built-in and custom) need to be wrapped in an #ifdef __cplusplus / #endif block to ensure that they are only built in Objective-C++ mode. See here for an example. It looks like the documentation in the wiki still needs to be updated to reflect this. Let me know if this helps!

from cedar.

PeqNP avatar PeqNP commented on July 17, 2024

That solved the issue! Using the example in the Wiki, I ended up changing the code to look like this:

#import <CoreMedia/CoreMedia.h>

#if TARGET_OS_IPHONE
#import <Cedar-iOS/ComparatorsBase.h>
#import <Cedar-iOS/StringifiersBase.h>
#else
#import <Cedar/ComparatorsBase.h>
#import <Cedar/StringifiersBase.h>
#endif

#ifdef __cplusplus

namespace Cedar { namespace Matchers { namespace Comparators {
    template<typename U>
    bool compare_equal(CMTimeRange const actualValue, const U & expectedValue) {
        return CMTimeRangeEqual(actualValue, expectedValue);
    }
}}}

namespace Cedar { namespace Matchers { namespace Stringifiers {
    inline NSString * string_for(const CMTimeRange value) {
        return [NSString stringWithFormat:@"%lld/%d (duration %lld/%d)", value.start.value, value.start.timescale, value.duration.value, value.duration.timescale];
    }
}}}

#endif

Thank you for the response!

from cedar.

briancroom avatar briancroom commented on July 17, 2024

Note that this was an unintentional breaking change. 0b92d9e should fix this such that custom matchers won't need the guard to be manually inserted anymore.

from cedar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.