#define IS_LEAP(n) ((!(((n) + 1900) % 400) || (!(((n) + 1900) % 4) && (((n) + 1900) % 100))) != 0)
#define WRAP(a,b,m) ((a) = ((a) < 0 ) ? ((b)--, (a) + (m)) : (a))
-#define SHOULD_USE_SYSTEM_LOCALTIME(a) ( USE_SYSTEM_LOCALTIME && (a) <= SYSTEM_LOCALTIME_MAX )
-#define SHOULD_USE_SYSTEM_GMTIME(a) ( USE_SYSTEM_GMTIME && (a) <= SYSTEM_GMTIME_MAX )
+#define SHOULD_USE_SYSTEM_LOCALTIME(a) ( \
+ USE_SYSTEM_LOCALTIME && \
+ (a) <= SYSTEM_LOCALTIME_MAX && \
+ (a) >= SYSTEM_LOCALTIME_MIN \
+)
+#define SHOULD_USE_SYSTEM_GMTIME(a) ( \
+ USE_SYSTEM_GMTIME && \
+ (a) <= SYSTEM_GMTIME_MAX && \
+ (a) >= SYSTEM_GMTIME_MIN \
+)
int _is_exception_century(Int64 year)
-#include <time.h>
-
#ifndef LOCALTIME64_H
# define LOCALTIME64_H
USE_SYSTEM_GMTIME
Should we use the system functions if the time is inside their range?
*/
-#define SYSTEM_LOCALTIME_MAX 2147483647 /* XXX Replace with LOCALTIME_MAX */
-#define SYSTEM_LOCALTIME_MIN -2147483648 /* XXX Replace with LOCALTIME_MIN */
+#define SYSTEM_LOCALTIME_MAX 2147483647 /* XXX Replace with LOCALTIME_MAX */
+#define SYSTEM_LOCALTIME_MIN -2147483647 /* XXX Replace with LOCALTIME_MIN */
#define SYSTEM_GMTIME_MAX GMTIME_MAX
#define SYSTEM_GMTIME_MIN GMTIME_MIN