Any xTIMEcomposer __VERSION__ like macro?

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
aclassifier
Respected Member
Posts: 483
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Any xTIMEcomposer __VERSION__ like macro?

Post 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


--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
User avatar
aclassifier
Respected Member
Posts: 483
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Post 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;
}
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
User avatar
ers35
Active Member
Posts: 62
Joined: Mon Jun 10, 2013 2:14 pm
Contact:

Post 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)
Attachments
version.zip
(1.69 KiB) Downloaded 300 times
version.zip
(1.69 KiB) Downloaded 300 times
Post Reply