From 2d9eee4ea95551f076d029591dc9d0b66a4d6c9f Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sat, 5 Jun 2010 18:17:55 +0000 Subject: [PATCH] Add struct tm which mimics the struct on unix. Also setup the types file into seperate namespaces for clarity. The corrosponding change to windows/utils.cpp snuck into r4437. Originally committed to SVN as r4438. --- aegisub/libaegisub/include/libaegisub/types.h | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/aegisub/libaegisub/include/libaegisub/types.h b/aegisub/libaegisub/include/libaegisub/types.h index dc013e83e..3282473dc 100644 --- a/aegisub/libaegisub/include/libaegisub/types.h +++ b/aegisub/libaegisub/include/libaegisub/types.h @@ -24,12 +24,40 @@ #pragma once namespace agi { + namespace type { -#if defined(_WIN32) + namespace win { typedef struct timeval { - long tv_sec; - long tv_usec; + long tv_sec; ///< seconds + long tv_usec; ///< microseconds } timeval; -#endif + +typedef struct tm { + int tm_sec; ///< seconds (0-59) + int tm_min; ///< minutes (0-59) + int tm_hour; ///< hours (0-23) + int tm_mday; ///< day of the month (1-31) + int tm_mon; ///< months since january (0-11) + int tm_year; ///< years since 1900 + int tm_wday; ///< day of the week since sunday (0-6) + int tm_yday; ///< days since january 1 (0-365) + int tm_isdst; ///< whether in DST or not + long tm_gmtoff; ///< GMT offset in seconds + char *tm_zone; ///< TZ abrivation +} tm; + + } // namespace win + + + + + namespace unix { + } // namespace unix + + namespace osx { + } // namespace osx + + + } // namespace type } // namespace agi