diff --git a/stepmania/src/DateTime.cpp b/stepmania/src/DateTime.cpp index 033f375b4e..ff349a3d5f 100644 --- a/stepmania/src/DateTime.cpp +++ b/stepmania/src/DateTime.cpp @@ -14,6 +14,33 @@ void DateTime::Init() ZERO( *this ); } +bool DateTime::operator<( const DateTime& other ) const +{ +#define COMPARE( v ) if(vother.v) return false; + COMPARE( tm_year ); + COMPARE( tm_mon ); + COMPARE( tm_mday ); + COMPARE( tm_hour ); + COMPARE( tm_min ); + COMPARE( tm_sec ); +#undef COMPARE + // they're equal + return false; +} + +bool DateTime::operator==( const DateTime& other ) const +{ +#define COMPARE(x) if( x!=other.x ) return false; + COMPARE( tm_year ); + COMPARE( tm_mon ); + COMPARE( tm_mday ); + COMPARE( tm_hour ); + COMPARE( tm_min ); + COMPARE( tm_sec ); +#undef COMPARE + return true; +} + DateTime DateTime::GetNowDateTime() { time_t now = time(NULL); diff --git a/stepmania/src/DateTime.h b/stepmania/src/DateTime.h index 778f11b034..17ee6135cc 100644 --- a/stepmania/src/DateTime.h +++ b/stepmania/src/DateTime.h @@ -41,31 +41,8 @@ struct DateTime DateTime(); void Init(); - bool operator<( const DateTime& other ) const - { - #define COMPARE( v ) if(vother.v) return false; - COMPARE( tm_year ); - COMPARE( tm_mon ); - COMPARE( tm_mday ); - COMPARE( tm_hour ); - COMPARE( tm_min ); - COMPARE( tm_sec ); - #undef COMPARE - // they're equal - return false; - } - bool operator==( const DateTime& other ) const - { -#define COMPARE(x) if( x!=other.x ) return false; - COMPARE( tm_year ); - COMPARE( tm_mon ); - COMPARE( tm_mday ); - COMPARE( tm_hour ); - COMPARE( tm_min ); - COMPARE( tm_sec ); -#undef COMPARE - return true; - } + bool operator<( const DateTime& other ) const; + bool operator==( const DateTime& other ) const; bool operator!=( const DateTime& other ) const { return !operator==(other); } static DateTime GetNowDateTime();