Jerome, All,
Well, okay, but there is more to it than that. Here is the current SystemC
API. Note that there are no macros, but the release string has a formal
structure.
namespace sc_core {
const char* sc_copyright();
const char* sc_version();
const char* sc_release();
}
Function sc_release shall return an implementation-defined string of the
following form:
<major#>.<minor#>.<patch>-<originator>
where <major#> represents the major release number, <minor#> represents
the minor release
number, <patch> represents the patch level, and <originator> represents
the originator of the
SystemC implementation. The intent is that this string should be
machine-readable by any SystemC
application that has an interest in checking the version or release number
of the SystemC
implementation.
The character set for each of these four fields shall be as follows:
a)The lower-case letters a-z
b)The upper-case letters A-Z
c)The decimal digits 0-9
d)The underscore character _
and here is the equivalent for TLM-2.0 (taken from the OSCI LRM, not just
the implementation):
namespace tlm
{
#define TLM_VERSION_MAJOR implementation_defined_number // For example, 2
#define TLM_VERSION_MINOR implementation_defined_number // 0
#define TLM_VERSION_PATCH implementation_defined_number // 1
#define TLM_VERSION_ORIGINATOR implementation_defined_string // "OSCI"
#define TLM_VERSION_RELEASE_DATE implementation_defined_date // "20090329"
#define TLM_VERSION_PRERELEASE implementation_defined_string // "beta"
#define TLM_IS_PRERELEASE implementation_defined_bool // TRUE
#define TLM_VERSION implementation_defined_string // "2.0.1_beta-OSCI"
#define TLM_COPYRIGHT implementation_defined_string
const unsigned int tlm_version_major;
const unsigned int tlm_version_minor;
const unsigned int tlm_version_patch;
const std::string tlm_version_originator;
const std::string tlm_version_release_date;
const std::string tlm_version_prerelease;
const bool tlm_is_prerelease;
const std::string tlm_version_string;
const std::string tlm_copyright_string;
inline const char* tlm_release();
inline const char* tlm_version();
inline const char* tlm_copyright();
} // namespace tlm
So the question is, do we want independent and parallel set of definitions
for SystemC and TLM-2.0 releases, or do we want to merge them to give a
single combined version? Having made that decision, do we want backward
compatibility with the current 1666 and TLM-2.0 definitions?
John A
From:
Jerome CORNET <jerome.cornet@st.com>
To:
"Philipp A. Hartmann" <philipp.hartmann@offis.de>
Cc:
john.aynsley@doulos.com, systemc-p1666-technical@eda.org
Date:
16/09/2010 13:59
Subject:
Re: Version number macros
Philipp,
sorry for the delay in the answer: obviously you are right (I should
have read the C++ norm more
carefully).
Agreed with all you said.
Regards,
Jerome
On 9/15/2010 11:29 AM, Philipp A. Hartmann wrote:
> Jerome,
>
> according to the C++ standard (17.4.3.1.2 [lib.global.names]), "certain
> sets of names and function signatures are always reserved to the [C++]
> implementation":
>
> - Each name that contains a double underscore (__) or begins with an
> underscore followed by an upper-case letter (2.11) is reserved to
> the implementation for any use.
>
> So I would prefer to have a macro name like SYSTEMC_IEEE_VERSION, or
> SYSTEMC_IEEE_1666. SYSTEMC_VERSION should not be used, since this is
> already used in (some) existing implementations.
>
> Thanks,
> Philipp
>
> On 14/09/10 13:17, Jerome CORNET wrote:
>> On 9/10/2010 4:07 PM, john.aynsley@doulos.com wrote:
>>> Jerome,
>>>
>>> After process control extensions, the next priority on the list is
>>> version number macros.
>>>
>>> You wrote:
>>>
>>> "Speaking of macros, I don't know if this has been planned, but it
>>> would be great (and standard practice) to specify a way to retrieve
>>> the version number of the norm that an implementation is following.
>>> (In our case that would be either 2005 or 2010 for now).
>>> The ISO C standard defines a macro __STDC__VERSION__ whose value is
>>> 199901L (integer long) for C99.
>>> ISO C++ also defines a macro, __cplusplus with value 199711L."
>>>
>>> Would you like to make a specific proposal?
>>>
>> John, All, (sorry for the slight delay)
>>
>> to me the best way is to follow the other standards' previous decisions
>> unless
>> we've got strong reasons for changing.
>>
>> So I would propose a macro (to allow test in #if) like this:
>>
>> __SYSTEMC_IEEE_VERSION with value 201001L
>>
>>
>> with 2010 be for 1666-2010 and 01 being reserved for minor revisions
(as
>> it is used for c++).
>>
>> If someone prefer a variations in the name (__SYSTEM_VERSION or
>> whatever), this is obviously
>> also ok for us.
>>
>>
>> Jerome
>>
>>
>>
>
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Tue Sep 28 04:17:17 2010
This archive was generated by hypermail 2.1.8 : Tue Sep 28 2010 - 04:17:18 PDT