Giter Site home page Giter Site logo

Comments (5)

arobenko avatar arobenko commented on July 19, 2024

Hi @bearbattle,
Thanks for the report. Looks like the "isMessageBase()" function is referenced in several other places as well without proper include. The "develop" branch should contain the fix. If no other problems are discovered, the correction release will be out soon.

from comms.

bearbattle avatar bearbattle commented on July 19, 2024

Hi @arobenko ,
When compiling this with MSVC cl.exe 19.16.27048, it gave me this error:

warning C4003: not enough arguments for function-like macro invocation 'min'

The error would cause ~\comms\install\include\comms\options.h:76 with other errors.

A solution is adding #define NOMINMAX macro to prevent 'dump' MSVC compiler from recognize std::numeric_limits<~>::min() as the min(a, b) macro.

Ref: numeric_limits::max() not recognized

As followed from this discussion, there are two ways around:

  1. #define NOMINMAX - it disables min(a, b) and max(a, b) macros, but std::min(a,b) and std::max(a, b) from are working fine
  2. #ifdef min
    #undef min
    #undef max
    #endif
    If it is placed in right place it works.

from comms.

arobenko avatar arobenko commented on July 19, 2024

Hi @bearbattle,
It is a bad practice for the library to impose compilation restrictions on the client code. It's the opposite that needs to apply, i.e. trying to adapt to the used compilation options. That's why I disable some warnings in some places and restore original state at the end of the "problematic" section. I cannot silently change the client code controlling defines in my headers. It may have nasty, unintended, difficult to debug consequences.

You've listed the solution yourself. If you don't use the Microsoft specific macros in you code, just use global "/D NOMINMAX" compilation option in your project. If you do use them, then you just do #define NOMINMAX before any windows specific includes (like #include <windows.h>) in the problematic file.

The bottom line, I'm not going to change anything in the library in this regard. Won't fix.

from comms.

arobenko avatar arobenko commented on July 19, 2024

By the way I just noticed that I did the include fix on the "master" branch by mistake, rather than on the develop. I'll do the "v5.0.2" correction release soon to keep the "master" branch pointing to the latest release.

from comms.

arobenko avatar arobenko commented on July 19, 2024

Original report is fixed in v5.0.2 release.

from comms.

Related Issues (2)

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.