Giter Club home page Giter Club logo

Comments (7)

syoyo avatar syoyo commented on August 23, 2024 1

Thank you! Confirmed it works on gcc5

So I guess its now OK to close the issue, @bkaradzic

from imguizmo.

syoyo avatar syoyo commented on August 23, 2024

Also, anonymous struct is non-standard thus it fails to compile with some compilers(at least I've confirmed g++5.3.0 cannot compile the code).

http://stackoverflow.com/questions/14248044/are-anonymous-structs-standard-and-really-what-are-they

It would be better to provide accessor method instead of anonymous union/struct.

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

Fixed
eb670e6

from imguizmo.

syoyo avatar syoyo commented on August 23, 2024

Thanks! But it still fails...

$ g++-5 ImGuizmo.cpp 
ImGuizmo.cpp:188:11: error: 'struct ImGuizmo::matrix_t::<anonymous union>::vect' invalid; an anonymous union can only have non-static data members [-fpermissive]
    struct vect
           ^
$ g++-5 -v
Using built-in specs.
COLLECT_GCC=g++-5
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc5/5.3.0/libexec/gcc/x86_64-apple-darwin15.4.0/5.3.0/lto-wrapper
Target: x86_64-apple-darwin15.4.0
Configured with: ../configure --build=x86_64-apple-darwin15.4.0 --prefix=/usr/local/Cellar/gcc5/5.3.0 --libdir=/usr/local/Cellar/gcc5/5.3.0/lib/gcc/5 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-5 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl014 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc5 5.3.0' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
Thread model: posix
gcc version 5.3.0 (Homebrew gcc5 5.3.0)

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

I have no gcc at home.
Please, can you try to replace the union with:

union
        {
            float m[4][4];
            float m16[16];
            struct
            {
                vec_t right, up, dir, position;
            } v;
        };

And tell me if it compiles. This doesn't give me any error with vc++.

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

anonymous struct in anonymous union. I don't know how this could go wrong :)

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

I've tested with online compilers and it works with the snippet above.

https://gcc.godbolt.org/#compilers:!((compiler:mips5,options:'-O3',sourcez:MQSwdgxgNgrgJgUwAQB4C2C0HsBOBPAOgAsA%2BAKDIGcAXHGCapANwQgH1qyBIAb24AcYAIyggIALm5cAZlCwBDRgA8ANEjxqAXmoDuAbjJJmWEHCQBlBNQAUshYyYBKJDyRKkAXnWekmnzp8mPSQAXykmEzNLGztFJDZVJFjGNg0kuTi2Py8ABgJpNWT4gNz851d3LwTgvB9U4Oz4zWCS4uCwshCDMhZ2RjR5AGsEADVWGIyUxKLUwsmmnzyC9PtixbKXZlYOJBwESmC9ygJK%2BKVD/YJaqrwL48asu4JWtn1dqxgcMHeD0IoaOgMJADWggJQcbh8LiCERiSRcLhSKQwMAgLBgKRQhFFNAAbQALABdAmEgwImTzNAARgAbLjaaSpFwAfROOSsQjejscCAAOZEahqGD8NRwEA4NT8LCUEDUNFgMkIkLMRVdCgIkE88E2CDomjAxRajgAMiQWGoRAQOHKwMwEH4eGsxupdJyhLUxvNlpwBBduLdahlmgQWGktkmzgAVEhaY52lJNWCONZyh0EVh%2BFbFLgVnFoynNntqJ9vi74%2BnMzhszgkLqwPrkvnnHX9a4iyXgbTy1wIqYkAAVKv1qCKeXh1YJOYTtIzTQ2i0gSgAWhIg/kw9H6OsA2GYwY1kn8TSWUccb%2B4UiA6HlBHcq3LYc22opqY1EcmKZTAIPP51AI0WsKl8jUJYQOApAljjT8CGFf8rGsUCY3AxDIMVHsCDFH0AJQ8CgOWVDoKlGU7zAOCbFfE41AotIKO0JDpCgpV1R7S9zAgeQoAQcdMmmeZZlzFI5w/ckvx/AUyIPRIcPwso0K/WDsPA/jpMYzkMPFCTpLULIwIYuSCCI2V5U05DTOWPDVLCTlWPYzjrAfLY%2BlNSgbTYjiuOORJjjSe4zzCNUgAA)),filterAsm:(commentOnly:!t,directives:!t,labels:!t),version:3

commit : e7f6a42

from imguizmo.

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.