Giter Site home page Giter Site logo

Comments (6)

cpq avatar cpq commented on May 29, 2024 2

@scaprile prepending MG_ is the way to go, we should not be polluting user's namespace
Will you take care of it please?

from mongoose.

cpq avatar cpq commented on May 29, 2024 1

I think the best way to deal with the realpath() type of issues, as well as all the other issues that arise from using things like mimalloc and similar tools, is to avoid using arch_win32.h - basically, our headers.

@gvanem So the realpath issue is different from the ENCRYPT macro, and should be fixed this way:

  1. Set -DMG_ARCH=DMG_ARCH_CUSTOM
  2. Make your own "mongoose_custom.h" and include there whatever deemed necessary - mimalloc, whatever.

@scaprile so please do just the ENCRYPT fix and don't touch realpath

from mongoose.

scaprile avatar scaprile commented on May 29, 2024

@cpq This is in the PD tls_aes128.[ch] files.
How should we proceed, do we prepend MG_ in both files or just #undef at the head of .h ?

from mongoose.

gvanem avatar gvanem commented on May 29, 2024

Here is another case; but only a redefinition warning. For this program:

#include <string.h>
#include <malloc.h>
#include <mimalloc/mimalloc-override.h> // From https://github.com/microsoft/mimalloc
#include <mongoose.h>
int main (void)
{
  return (0);
}

I get:

In file included from mongoose-ntddndis-error.c:6:
./externals\mongoose.h(499,9): warning: 'realpath' macro redefined [-Wmacro-redefined]
  499 | #define realpath(a, b) _fullpath((b), (a), MG_PATH_MAX)
      |         ^
./externals\mimalloc/mimalloc-override.h(28,9): note: previous definition is here
   28 | #define realpath(f,n)           mi_realpath(f,n)
      |         ^
1 warning generated.

Since _fullpath() allocates memory internally, mimalloc has this override function mi_realpath() for it.

from mongoose.

cpq avatar cpq commented on May 29, 2024

Thank you @gvanem !

from mongoose.

scaprile avatar scaprile commented on May 29, 2024

@cpq How should we proceed with this last one ? Redefinition will depend on the order of inclusion, if we undef then the other one will warn. There is no undef in mimalloc-override https://github.com/microsoft/mimalloc/blob/master/include/mimalloc-override.h . Checking for mi_realpath and using theirs may not be a good choice.

from mongoose.

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.