[M3devel] utime.i3 and imported data

Jay jayk123 at hotmail.com
Tue Feb 12 16:57:25 CET 2008


For good reason, imported (dynamically linked) data doesn't work great on Win32.
Functions work much better. Data can work, but you generally need the header to say __declspec(dllimport), to change it to a declaration of a pointer. I've seen GNU ld has some workaround but I'm not familiar with it, it doesn't worthwhile to me, and I'm having a problem.
 
I strongly suggest all the Utime.i3:
 
<*EXTERNAL*> VAR timezone: time_t;<*EXTERNAL*> VAR daylight: int;<*EXTERNAL*> VAR tzname: ARRAY [0..1] OF char_star;
be changed to functions:
 
<*EXTERNAL Utime__get_timezone*> get_timezone(): time_t;<*EXTERNAL Utime__get_daylight*> get_daylight(): int;<*EXTERNAL Utime__get_tzname*> get_tzname(a: [0..1]): char_star;
 
with an implementation in C:
 
UtimeC.c#include <time.h>
time_t Utime__get_timezone(void){    return timezone;}
 
int Utime__get_daylight(void){    return daylight;}
 
char* Utime__get_tzname(unsigned a){    return tzname[a];}
for now I'm going to try another workaround..where NT386GNU has this data as not external and some C code to call tzset and then copy the data from the C globals to Modula-3 globals.
 
The datetime feature I added to Quake is crashing, I think due to this...
 
 - Jay
_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080212/a54fd9d9/attachment-0001.html>


More information about the M3devel mailing list