MatteoLacki / IsoSpec

Libraries for fine isotopic structure calculator.
Other
35 stars 10 forks source link

#define ISOSPEC_NUMBER_OF_ISOTOPIC_ENTRIES 288 #26

Closed lopippo closed 5 years ago

lopippo commented 5 years ago

Greetings,

I am using IsoSpec and in the crafting of a GUI interface for it, I want to perform a sanity check that the number of elements read from the various arrays is actually the right number. The

define ISOSPEC_NUMBER_OF_ISOTOPIC_ENTRIES 288

is not very useful when I want to refer to it in my program. Would it be reasonable to change that #define macro to something like:

const std::size_t ISO..ENTRIES = 288

that could later be referred to as IsoSpec::ISO..ENTRIES

Thanks a lot, Cheers, Filippo

michalsta commented 5 years ago

Good suggestion, thanks, implemented in a9dd1e3c90043e00ecaa346064df89f53e7905cf

I've decided to keep the #define for better backward compatibility, but I added a const size_t isospec_number_of_isotopic_entries next to it. That way we don't break code that depends on ISOSPEC_NUMBER_OF_ISOTOPIC_ENTRIES being a macro (not sure though if that's even possible), and export a symbol that can bee looked up in the .so without access to the header.

Feel free to reopen this issue if that's not what you need.