Page 1 of 1

Any xTIMEcomposer __VERSION__ like macro?

Posted: Thu May 18, 2017 5:31 pm
by aclassifier
Is there any __VERSION__ predefine for xTIMEcomposer that will yield something like "14.2.4"?

__VERSION__ yields "4.2.1 Compatible Clang 3.6.0" on xTIMEcomposer 14.2.4

Re: Any xTIMEcomposer __VERSION__ like macro?

Posted: Tue May 23, 2017 11:20 am
by infiniteimprobability

Re: Any xTIMEcomposer __VERSION__ like macro?

Posted: Tue May 23, 2017 8:58 pm
by aclassifier
Thanks, but no! "14.3.1" from __XTIMECOMPOSER__ is on my wish list!

Code: Select all

void test(void)
{
    const char  version_str []        = __VERSION__;
    unsigned    xc_val                = __XC__;
    unsigned    xcc_version_major_val = XCC_VERSION_MAJOR;
    // unsigned xtimecomposer_str []  = __XTIMECOMPOSER__;

    printf("__VERSION__=\"%s\", __XC__=%u, XCC_VERSION_MAJOR=%u\n", version_str, xc_val, xcc_version_major_val);
    printf("__VERSION__=\"%s\", __XC__=%u, XCC_VERSION_MAJOR=%u,\n%s\n", __VERSION__, __XC__, XCC_VERSION_MAJOR,
            "but xTIMEcomposer is \"Version: Community_14.2.4 (build 15898, Dec-20-2016)\"");

    // PRINTS:
    /*
    __VERSION__="4.2.1 Compatible Clang 3.6.0 ", __XC__=1, XCC_VERSION_MAJOR=1402
    __VERSION__="4.2.1 Compatible Clang 3.6.0 ", __XC__=1, XCC_VERSION_MAJOR=1402,
    but xTIMEcomposer is "Version: Community_14.2.4 (build 15898, Dec-20-2016)"
    */
}

int main() {
    par {
        test();
    }
    return 0;
}

Re: Any xTIMEcomposer __VERSION__ like macro?

Posted: Thu May 25, 2017 2:09 am
by ers35
As a workaround you can generate a header file containing the version using a Makefile. See the attached example.

Code: Select all

$ xmake
$ xsim bin/main.xe 
Community_14.2.4 (build 15898, Dec-20-2016)