Giter Site home page Giter Site logo

Comments (4)

mvandervoord avatar mvandervoord commented on July 24, 2024

I think both 1&2 are the way to go. We'll disable weak support for win32 (I wonder why the clang developers don't have all the features enabled for that platform?) for now. Then we can give an additional way to override the defaulted selection with either UNITY_INCLUDE_WEAK or UNITY_EXCLUDE_WEAK.

We've been evolving towards this standard of guessing as much as we can, and then giving the developer support to override those settings with include/exclude options.

If you're feeling up to tweaking one of your versions to do this, that would be awesome. Otherwise, just say so and I'll tackle it when I get some time.

Thanks so much!

Mark

from unity.

zanedp avatar zanedp commented on July 24, 2024

I'm not sure why Clang's not including the weak attributes in the object code. I verified using nm that when I compile with gcc on Windows, the weak attribute is output, but with both clang 3.5.0 and 3.6.0 SVN r223387 it is missing.

I've tried playing around with #pragma weak setUp etc, but that didn't help.

from unity.

zanedp avatar zanedp commented on July 24, 2024

Should Unity have an option to choose whether #pragma weak <symbol> is to be used vs __attribute__((weak)): UNITY_WEAK_PRAGMA vs UNITY_WEAK_ATTRIBUTE definitions to decide which syntax to use? For example, in unity.c:

#if defined(UNITY_WEAK_ATTRIBUTE)
    UNITY_WEAK_ATTRIBUTE void setUp(void) { }
    UNITY_WEAK_ATTRIBUTE void tearDown(void) { }
#elif defined(UNITY_WEAK_PRAGMA)
#   pragma weak setUp
    void setUp(void);
#   pragma weak tearDown
    void tearDown(void);
#else
    void setUp(void);
    void tearDown(void);
#endif

UNITY_WEAK_ATTRIBUTE could be set to __attribute__((weak)) for gcc and Clang or __weak for Keil.

from unity.

mvandervoord avatar mvandervoord commented on July 24, 2024

I've merged your patch. Thanks so much!

from unity.

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.