RE: [Dev-C++] Thanks and Another question (windows/linux)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Abhijit S. <mu...@gm...> - 2003-08-03 18:02:23
|
> Since you have worked in windows, could you tell me: time_t or this kind
of things are not used > in windows? I asked because I open both files:
time.h and timeb.h and while time.h seems very
> complete (with the definition of time_t for instance) , timeb.h seems
incomplete. Is there a
> equivalent of time_t for windows. Is the file timeb.h correct? Or for that
matter should I
> cheat the compiler and make it think we are in windows....hummm. I am
confused. Are those files
> complete? Sorry for so many questions, it is that I want to start working
already and I am
> stuck in the no compilation problem and the Aria guys dont answer me yet
:(
Hello, Pukara.
Try #including <time.h> before all your Aria headers. <time.h> is ANSI, and
is portable. I don't know why they've decided not to work with it on
Windows, but you can try it out anyway.
Specifically:
* time_t is legal.
* timeb.h is the header for the Unix ftime() function, and is not ANSI.
Here's a dump of what my reference says about ftime():
-- Cut here --
Syntax
#include <sys\timeb.h>
void ftime(struct timeb *buf)
Description
Stores current time in timeb structure.
On UNIX platforms ftime is available only on System V systems.
ftime determines the current time and fills in the fields in the timeb
structure pointed to by buf. The timeb structure contains four fields: time,
millitm, _timezone, and dstflag:
struct timeb {
long time ;
short millitm ;
short _timezone ;
short dstflag ;
};
time provides the time in seconds since 00:00:00 Greenwich mean time (GMT)
January 1 1970.
millitm is the fractional part of a second in milliseconds.
_timezone is the difference in minutes between GMT and the local time. This
value is computed going west from GMT. ftime gets this field from the global
variable _timezone which is set by tzset.
dstflag is set to nonzero if daylight saving time is taken into account
during time calculations.
Note: ftime calls tzset. Therefore it isn't necessary to call tzset
explicitly when you use ftime.
Return Value
None.
Borland C++ 5.0 Programmer's Guide
-- Cut here --
--
Abhijit Shylanath
Homepage: http://mudeth.tripod.com/
|