end2endzone / RapidAssist

RapidAssist is a lite cross-platform library that assist you with the most c++ repetitive tasks.
MIT License
5 stars 0 forks source link

Move ra::environment::IsConfigurationDebug() implementation in header file #47

Closed end2endzone closed 4 years ago

end2endzone commented 4 years ago

The functions ra::environment::IsConfigurationDebug() and ra::environment::IsConfigurationRelease() implementation should be moved to the header file so that it can be called from other application that uses RapidAssist.

end2endzone commented 4 years ago

Do the same for ra::timing::GetCopyrightYear()

end2endzone commented 4 years ago
int GetCopyrightYear(const char * compilation_date) {
    static const int DEFAULT_YEAR = 2016;
    std::string compilation_date_str = __DATE__;
    size_t last_space_index = compilation_date_str.find_last_of(" ");
    if (last_space_index == std::string::npos)
      return DEFAULT_YEAR;
    const char * yearStr = &compilation_date_str[last_space_index + 1];
    int year = atoi(yearStr);
    return year;
}

int GetCopyrightYear() { return GetCopyrightYear(__DATE__); }