#include "ppSim.h"


psString ppSimVersion(void)
{
#ifndef PPSIM_VERSION
#error "PPSIM_VERSION is not set"
#endif
#ifndef PPSIM_BRANCH
#error "PPSIM_BRANCH is not set"
#endif
    return psStringCopy(PPSIM_BRANCH "@" PPSIM_VERSION);
}

psString ppSimSource(void)
{
#ifndef PPSIM_SOURCE
#error "PPSIM_SOURCE is not set"
#endif
    return psStringCopy(PPSIM_SOURCE);
}

psString ppSimVersionLong(void)
{
    psString version = ppSimVersion();  // Version, to return
    psString source = ppSimSource();    // Source

    psStringPrepend(&version, "ppSim ");
    psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__);
    psFree(source);

#ifdef __OPTIMIZE__
    psStringAppend(&version, " optimised");
#else
    psStringAppend(&version, " unoptimised");
#endif

    return version;
};
