Macros allow preprocessor determination of these values. This allows compile-time examination to allow for work-arounds when there is an important incompatibility that needs to be addressed. For instance, as an IP provider I might discover that my implementation doesn't work with vendor X's version Y implementation of SystemC due to a bug. My customer may not want to move to the latest release, but I want to provide IP that works.
Of course this only works for the numeric macros, and we are missing the somewhat expected _VENDOR_NAME or _ORIGINATOR variables to allow for example
// Assume if originator is OSCI then _OSCI is defined...
#if defined(_OSCI) && SC_VERSION_MAJOR == 2 && SC_VERSION_MINOR == 2 && SC_VERSION_PATCH < 3
// work-around for broken feature XYZ
#endif
On Dec 22, 2010, at 4:24 AM, Bart Vanthournout wrote:
> 9.6.1: why are we defining macro’s for version and copyright? Shouldn’t we stick to functions and variables only, or at least indicate a preference?
>
------------------------------------------------------
David C Black, System-Level Specialist
XtremeEDA USA Corporation http://www.Xtreme-EDA.com
(Consulting, Services & Training for all your ESL design assurance needs)
Voice: 512.850.4322 Skype: dcblack FAX: 888.467.4609
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Dec 22 03:52:41 2010
This archive was generated by hypermail 2.1.8 : Wed Dec 22 2010 - 03:52:45 PST