John, all,
I've checked this again. TRUE and FALSE are neither part of the C nor
the C++ standard.
They are defined by some platforms (e.g. on Windows), and also
commonly defined in C applications, but the latter mostly due to the
lack of proper bool support.
Wrt. to backwards compatibility, I highly doubt that there are
frequent uses of this, since the current TLM-2 kit is just broken in
that regard. Try the following on a non-Windows platform:
// ---8<---
#include <systemc>
#include <tlm.h>
int sc_main( int, char*[] )
{
# if TLM_IS_PRERELEASE == TRUE
std::cout << "TLM pre-release" << std::endl;
# endif
# if TLM_IS_PRERELEASE == FALSE
std::cout << "TLM not a pre-release" << std::endl;
# endif
return 0;
}
// --->8---
This prints, _both_ lines on my default Linux/GCC 4.4 platform, since
TRUE and FALSE are undefined. And comparing two undefined symbols is
quite … undefined. ;-)
Greetings from Oldenburg,
Philipp
On 11/01/11 13:37, john.aynsley@doulos.com wrote:
> All,
>
> Philipp writes:
>
>
> 9.6.5 SystemC Version
> 11.8.1 TLM version information
>
> SC_IS_PRERELEASE
> TLM_IS_PRERELEASE
>
> "... flag shall be either FALSE or TRUE, not enclosed in quotation
> marks."
>
> Hmmm, maybe 'true' or 'false' (lower-case) would be more portable?
> Or even an application-defined integral constant expression evaluating
> to 0/1 (or false/true).
>
>
> [JA] I guess FALSE and TRUE are still required for backward compatibility
> in the TLM-2.0 world?
>
> Opinions?
>
> John A
>
>
>
-- Philipp A. Hartmann Hardware/Software Design Methodology Group OFFIS Institute for Information Technology R&D Division Transportation · FuE-Bereich Verkehr Escherweg 2 · 26121 Oldenburg · Germany · http://offis.de/en/ Phone/Fax: +49-441-9722-420/282 · PGP: 0x9161A5C0 · Skype: phi.har -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Tue Jan 11 17:43:54 2011
This archive was generated by hypermail 2.1.8 : Tue Jan 11 2011 - 17:43:58 PST