MengeCrowdSim / Menge

The source code for the Menge crowd simulation framework
Apache License 2.0
138 stars 64 forks source link

Clean up debug/assertion dependent code #30

Open MengeCrowdSim opened 7 years ago

MengeCrowdSim commented 7 years ago

There are places in the code where some code is in place to support assertions. By design, assertions should be executed only in some form of debug mode. The code exhibits aspects like:

#if _DEBUG
...
#endif

Under g++ the documentation suggests that assert method are invoked unless the symbol NDEBUG is found prior to reading the cassert header. That would suggest a change to this:

#ifndef NDEBUG
...
#endif

It is important to make sure this solution works both in linux and windows. Does windows use the _DEBUG instead? Either way, this needs to be addressed to work with older compilers and g++5.

See #28 for an example.

MengeCrowdSim commented 7 years ago

Further investigation suggests that this old form is just sloppy. The idea that two pre-compiler directives were correlated: i.e., in windows when you build with _DEBUG it typically sets NDEBUG. Generally, for C++ this is the symbol that should be tested for:

C++ docs Windows docs