2004-04-02
2004-04-02 13:07:09 by Henrik Grubbström (Grubba) <grubba@grubba.org>
-
655197eafcb2a3bf2a5d2bd5635080e80b2435e3
(27 lines)
(+11/-16)
[
Show
| Annotate
]
Branch: 7.4
Backported localtime() fix from Pike 7.5.
Rev: src/builtin_functions.c:1.465
2:
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
- || $Id: builtin_functions.c,v 1.464 2003/10/19 16:56:00 mast Exp $
+ || $Id: builtin_functions.c,v 1.465 2004/04/02 13:07:09 grubba Exp $
*/
#include "global.h"
- RCSID("$Id: builtin_functions.c,v 1.464 2003/10/19 16:56:00 mast Exp $");
+ RCSID("$Id: builtin_functions.c,v 1.465 2004/04/02 13:07:09 grubba Exp $");
#include "interpret.h"
#include "svalue.h"
#include "pike_macros.h"
4125: Inside #if defined(HAVE_LOCALTIME)
pop_n_elems(args);
encode_struct_tm(tm);
- #ifdef STRUCT_TM_HAS_GMTOFF
+
push_string(make_shared_string("timezone"));
-
+ #ifdef STRUCT_TM_HAS_GMTOFF
push_int(-tm->tm_gmtoff);
- f_aggregate_mapping(20);
- #else
- #ifdef STRUCT_TM_HAS___TM_GMTOFF
- push_string(make_shared_string("timezone"));
+ #elif defined(STRUCT_TM_HAS___TM_GMTOFF)
push_int(-tm->__tm_gmtoff);
- f_aggregate_mapping(20);
+ #elif defined(HAVE_EXTERNAL_TIMEZONE)
+ /* Assume dst is one hour. */
+ push_int(timezone - 3600*tm->tm_isdst);
#else
- #ifdef HAVE_EXTERNAL_TIMEZONE
- push_string(make_shared_string("timezone"));
- push_int(timezone);
- f_aggregate_mapping(20);
- #else
- f_aggregate_mapping(18);
+ /* Assume dst is one hour. */
+ push_int(-3600*tm->tm_isdst);
#endif
- #endif
- #endif
+ f_aggregate_mapping(20);
}
#endif