Revision 1.05 changes

This commit is contained in:
llsth 2015-07-26 10:45:18 +02:00
parent c086e3bea2
commit e966ac7d55
4 changed files with 18 additions and 8 deletions

4
configure vendored
View File

@ -1,3 +1,5 @@
#!/bin/sh #!/bin/sh
# #
# Copyright (c) 2015 Carsten Larsen # Copyright (c) 2015 Carsten Larsen
@ -177,7 +179,7 @@ if $VALID ; then
echo "LDLIBS = -lm" echo "LDLIBS = -lm"
elif [ -n "$1" ] && [ $1 = "AROS" ] ; then elif [ -n "$1" ] && [ $1 = "AROS" ] ; then
echo 'CC = gcc' echo 'CC = gcc'
echo "CFLAGS = -O2 -DAROS -I. -Iinclude -Wall -Werror" echo "CFLAGS = -O2 -DAROS -DWITHTEST -I. -Iinclude -Wall -Werror"
echo "LDLIBS = -lm" echo "LDLIBS = -lm"
else else
echo "CFLAGS = -O2 -Wall -DWITHTEST -Werror" echo "CFLAGS = -O2 -Wall -DWITHTEST -Werror"

View File

@ -27,7 +27,7 @@
#define NTIMED_PLATFORM_H #define NTIMED_PLATFORM_H
//--------------------------------------------------------------------------// //--------------------------------------------------------------------------//
#if defined(AROS) || defined(AOS3) #if defined(AROS) || defined(AOS3)
# define AMIGA_VERSION " 1.04 (25.07.2015)" # define AMIGA_VERSION " 1.05 (26.07.2015)"
# ifndef AMIGA # ifndef AMIGA
# define AMIGA # define AMIGA
# endif # endif

View File

@ -72,6 +72,9 @@
# include "clib/timezone_protos.h" # include "clib/timezone_protos.h"
# include "inline/timezone.h" # include "inline/timezone.h"
#endif #endif
#ifdef AROS
# include <time.h>
#endif
int repeat_trace = 0; int repeat_trace = 0;
@ -173,6 +176,7 @@ PutHex(struct ocx *ocx, enum ocx_chan chan, const void *ptr, ssize_t len)
void void
PutTime(struct ocx *ocx, enum ocx_chan chan, const char *fmt, const struct timestamp *ts) PutTime(struct ocx *ocx, enum ocx_chan chan, const char *fmt, const struct timestamp *ts)
{ {
#ifdef AMIGA
FILE *dst; FILE *dst;
struct tm tm; struct tm tm;
static char buf[80]; static char buf[80];
@ -188,6 +192,7 @@ PutTime(struct ocx *ocx, enum ocx_chan chan, const char *fmt, const struct times
fflush(dst); fflush(dst);
} }
} }
#endif
} }
void void

View File

@ -48,6 +48,9 @@
# include "clib/timezone_protos.h" # include "clib/timezone_protos.h"
# include "inline/timezone.h" # include "inline/timezone.h"
#endif #endif
#ifdef AROS
# include <time.h>
#endif
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
// 2922 is the number of days between 1.1.1970 and 1.1.1978 // 2922 is the number of days between 1.1.1970 and 1.1.1978
// (2 leap years and 6 normal) // (2 leap years and 6 normal)
@ -189,9 +192,9 @@ void amiga_init_offset()
now = time(NULL); now = time(NULL);
localtime_r(&now, &tm); localtime_r(&now, &tm);
gmtoffset = tm.tm_gmtoff; gmtoffset = tm.tm_gmtoff;
abbr = tm.tm_zone; abbr = (char*)tm.tm_zone;
} else { } else {
gmtoffset = locale->loc_GMTOffset * 60 * 60; gmtoffset = locale->loc_GMTOffset * 60;
abbr = '\0'; abbr = '\0';
} }
@ -201,9 +204,9 @@ void amiga_init_offset()
"Time zone is GMT %s %.f%s%s%s", "Time zone is GMT %s %.f%s%s%s",
(gmtoffset >= 0.0 ? "+" : "-"), (gmtoffset >= 0.0 ? "+" : "-"),
fabs((float)gmtoffset / 60.0 / 60.0), fabs((float)gmtoffset / 60.0 / 60.0),
(abbr != '\0' ? " (" : '\0'), (abbr != '\0' ? " (" : ""),
(abbr != '\0' ? abbr : '\0'), (abbr != '\0' ? abbr : ""),
(abbr != '\0' ? ")" : '\0') (abbr != '\0' ? ")" : "")
); );
} }
@ -288,7 +291,7 @@ void amiga_save_time(void)
struct tm tm; struct tm tm;
struct timeval tv; struct timeval tv;
int gmtoffset = 0; int gmtoffset = 0;
char *message = '\0'; char *message = "";
// Assume HW clock is in GMT if timezone library is present // Assume HW clock is in GMT if timezone library is present
if (TimezoneBase) { if (TimezoneBase) {