diff options
author | jylefort <jylefort@FreeBSD.org> | 2005-04-22 03:11:08 +0800 |
---|---|---|
committer | jylefort <jylefort@FreeBSD.org> | 2005-04-22 03:11:08 +0800 |
commit | 8fbee5a81ee59c81b36b919a401cfa5d042f0fa5 (patch) | |
tree | 538d04482984f89f51d676a6beb2171101591a60 /lang/see | |
parent | 52edeb412981c86e6719f0774fea39a185173c01 (diff) | |
download | freebsd-ports-gnome-8fbee5a81ee59c81b36b919a401cfa5d042f0fa5.tar.gz freebsd-ports-gnome-8fbee5a81ee59c81b36b919a401cfa5d042f0fa5.tar.zst freebsd-ports-gnome-8fbee5a81ee59c81b36b919a401cfa5d042f0fa5.zip |
Fix return value of local timezone methods such as getHours().
PR: ports/80198
Submitted by: Simun Mikecin <sime@logos.hr> (maintainer)
Approved by: adamw (mentor, implicit)
Diffstat (limited to 'lang/see')
-rw-r--r-- | lang/see/Makefile | 2 | ||||
-rw-r--r-- | lang/see/files/patch-libsee_obj__Date.c | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/lang/see/Makefile b/lang/see/Makefile index 3cc58db46f19..77a8457eb876 100644 --- a/lang/see/Makefile +++ b/lang/see/Makefile @@ -7,7 +7,7 @@ PORTNAME= see PORTVERSION= 1.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= lang MASTER_SITES= http://www.netsw.org/softeng/lang/js/ \ http://www.adaptive-enterprises.com.au/~d/software/see/ diff --git a/lang/see/files/patch-libsee_obj__Date.c b/lang/see/files/patch-libsee_obj__Date.c new file mode 100644 index 000000000000..6fab5842d2ea --- /dev/null +++ b/lang/see/files/patch-libsee_obj__Date.c @@ -0,0 +1,26 @@ +--- libsee/obj_Date.c.orig 2004-10-17 15:50:50.000000000 +0200 ++++ libsee/obj_Date.c 2005-04-21 14:51:24.086576359 +0200 +@@ -113,13 +113,16 @@ + static SEE_number_t DateFromTime(SEE_number_t); /* 15.9.1.5 */ + #define WeekDay(t) modulo(Day(t)+4,7) /* 15.9.1.6 */ + +-/* +- * XXX TODO: timezone conversion functions. Currently we assume local == UTC +- */ +-#define LocalTZA 0 /* 15.9.1.7 */ +-#define DaylightSavingTA(t) 0 /* 15.9.1.8 */ +-#define LocalTime(t) ((t) + LocalTZA + DaylightSavingTA(t)) /* 15.9.1.9 */ +-#define UTC(t) ((t) - LocalTZA - DaylightSavingTA(t - LocalTZA)) ++#define UTC(t) (t) ++SEE_number_t LocalTime(SEE_number_t t) { ++ SEE_number_t ret; ++ const time_t tt=time(NULL); ++ ret=timegm(localtime(&tt)); ++ ret-=tt; ++ ret*=1000; ++ ret+=t; ++ return ret; ++} + + /* 15.9.1.10 */ + #define HourFromTime(t) modulo(floor((t) / msPerHour), HoursPerDay) |