Code Monkey home page Code Monkey logo

Comments (5)

tbeu avatar tbeu commented on August 29, 2024

Do you see what I mean? Check the compiled executable model generated by Dymola and you will notice that it exports those function symbols which is simply not necessary.

The proposed change in CompatibilityDefs.h is simple:

#if defined(MDD_EXPORTS)
# define DllExport __declspec( dllexport ) 
#else
# define DllExport
#endif

You then need to define MDD_EXPORTS only when you build ITI_MDD.dll, ITI_MDDSoftingCAN.dll and MDDSpaceMouse.dll.

For sake of completeness there could also be a MDD_IMPORTS but this is currently not needed since DllImport is referenced nowhere.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

Right, this could be done. But what's the harm if some symbols are exported that are not needed?

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

The size of the executable is smaller. I though you would prefer minimum size.

And it is clean programming of course.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

Thanks for that explanation. Minimum size is nice, but I guess the difference isn't so much and keeping things as simple as possible is also a good thing. So I keep it as it is. However, I have no strong opinion about it, so if you have a strong opinion to limit the visibility we'll put that extra logic into the code and the build process.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

I checked it with TestSerialPackager_SoftingCAN.exe where executable size decreased from 458240 Bytes to 453632 Bytes.

Also I have no idea why would an executable export symbols?

I will probably change it in my fork anyway.

from modelica_devicedrivers.

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.