Giter VIP home page Giter VIP logo

Comments (12)

bkaradzic avatar bkaradzic commented on July 24, 2024

Don't know how this is related to bx or bgfx? What's the actual issue here?!

from bgfx.

Zarklord avatar Zarklord commented on July 24, 2024

If you enable the confirming preprocessor, bx and bgfx cannot compile

from bgfx.

bkaradzic avatar bkaradzic commented on July 24, 2024

But what's the issue?

What about GCC and Clang, they don't have conforming processor?

from bgfx.

Zarklord avatar Zarklord commented on July 24, 2024

The issue is you have preprocessor macros that only run on msvc (that overcome the issues), precisely because msvc has a non conforming preprocessor, like this one: https://github.com/bkaradzic/bx/blob/dc3bf2990e62e8e8764de1f430637aa26e333296/include/bx/macros.h#L14

from bgfx.

mcourteaux avatar mcourteaux commented on July 24, 2024

I think he's saying that the workarounds are no longer needed with an up-to-date version of MSVC (potentially after adding the /Zc:preprocessor flag. Not really an issue if you ask me, but more of a hint that these can be refactored in the future.

from bgfx.

Zarklord avatar Zarklord commented on July 24, 2024

I think he's saying that the workarounds are no longer needed with an up-to-date version of MSVC (potentially after adding the /Zc:preprocessor flag. Not really an issue if you ask me, but more of a hint that these can be refactored in the future.

Nope, you actually can't ever refactor these out, unless you want to drop support for all MSVC compilers older than VS 2017 V15.8 (and that don't have the flag set), additionally, leaving it alone will prevent this from compiling on C++20 for MSVC (or if the flag has been set) because the current MSVC macros workarounds break during compilation with a conforming preprocessor.

Because of the cpp world we live in, the msvc macro workarounds just need to check if the non conforming preprocessor is also enabled, otherwise you lose backwards or forwards compatibility.

from bgfx.

bkaradzic avatar bkaradzic commented on July 24, 2024

leaving it alone will prevent this from compiling on C++20 for MSVC

bx/bgfx/etc. is only C++17 right now. ETA for C++20 adoption is sometime in 2025.

At some point I'll just flip the switch to new MSVC conforming preprocessor. Until then we assume it doesn't have conforming preprocessor.

from bgfx.

Zarklord avatar Zarklord commented on July 24, 2024

leaving it alone will prevent this from compiling on C++20 for MSVC

bx/bgfx/etc. is only C++17 right now. ETA for C++20 adoption is sometime in 2025.

At some point I'll just flip the switch to new MSVC conforming preprocessor. Until then we assume it doesn't have conforming preprocessor.

Unless I'm misreading something in GENie, BGFX compiles as c++14 on MSVC...

But also why are you even against adding a few lines of code to support a compiler option that you're going to have to support next year anyway?

from bgfx.

bkaradzic avatar bkaradzic commented on July 24, 2024

Unless I'm misreading something in GENie, BGFX compiles as c++14 on MSVC...

https://github.com/bkaradzic/bx/blob/3072cf37dfb4b91da2ac057815ee8f0b209424d8/scripts/toolchain.lua#L209

But also why are you even against adding a few lines of code to support a compiler option that you're going to have to support next year anyway?

Because every separate code path adds maintenance cost... Once I decide it's time to support it, I'll spend time to remove old code paths.

from bgfx.

Zarklord avatar Zarklord commented on July 24, 2024

https://github.com/bkaradzic/bx/blob/3072cf37dfb4b91da2ac057815ee8f0b209424d8/scripts/toolchain.lua#L209

Ah, I missed that because I forgot to check BX.

Because every separate code path adds maintenance cost... Once I decide it's time to support it, I'll spend time to remove old code paths.

But it's not a separate code path, it's adding an extra condition to the couple places that have this divergent behavior, the only way that this would add a new line of code is if you chose to wrap the checking in a "BX_HAS_TRADITIONAL_MSVC_PREPROCESSOR" macro or something like that, either way your just &&-ing an extra conditional(s) onto the couple places with the already if elsed MSVC traditional preprocessor behavior.

from bgfx.

bkaradzic avatar bkaradzic commented on July 24, 2024

@Zarklord you're wasting my time... I don't have time to bikeshed about some nonsense. If you need this, you can fork bx/bgfx and modify it for yourself.

I don't see the issue with current setup.

from bgfx.

Zarklord avatar Zarklord commented on July 24, 2024

@Zarklord you're wasting my time... I don't have time to bikeshed about some nonsense. If you need this, you can fork bx/bgfx and modify it for yourself.

I don't see the issue with current setup.

It's ironic that your complaining about not having time to talk about this when it would have taken less time to fix the problem than write that comment...
Regardless I look forward to you making this change anyway in like 6 months to a year when you go to support c++20 👍🏻.

from bgfx.

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.