John M McIntosh wrote:
Tim fled to his cabin in the mountains and asked me to update source forge with some changes after I verified they worked ok on the mac.
OK, I'm all fled now (wierd - the weather here in the mountains/foothills is warmer and nicer than in sillycon valley) and ready to try to explain a few more points
cross/sq.h
A typedef for long long int to make acorn users happy, actually acorn users get long int (32bit) since the compiler doesn't support long long (64bits).
Actually _that_ change is in Cross/sqVirtualMachine.h and really, really needs a nicer way of specifying the choice. Meta programming of the C compiler would be nice here; can I do anything like #if sizeof(sqeakFileOffsetType) == 4 #define squeakInt64 long long #else #define squeakInt64 long int #endif ?? I actually tried that with no success :-( but there really must be some way to do it. A crucial point is that it must be ansi spec, not ISO or 'it works ok in gcc'. Why is ansi important? Ask me once you've tried doing ports to minimal systems with just an ansilibrary and monitor.
cross/sqFilePluginBasicPrims.c
Revert back to pure ansi, overrides are now done in platform specific header for 64 bit file io, and for ftruncate support (#define sqFTruncate to something).
ftruncate isn't ansi, which is why it had to be factored out. platform specific code can do anything required (I'll be going via direct RiscOS calls when I get time) or leave the default of 'fail'
For 64bit file io:
a) Your platform compiler must support long long int, pointless otherwise. b) you must typedef squeakFileOffsetType to the 64bit file offset type (possibly off_t, but you need to verify the number of bits, some u**x environments are broken)
Broken might be a bit harsh ;-) let's say offsetually challenged. On my RedHat 7.1 install, it turns out that sizeof(off_t) is 4 - on John OS-X machine it is 8.
fseek to the 64bit fseeko? ftell to the 64bit ftello?
unix/sqPlatformSpecific.h include <unistd.h> for ftruncate enable 64bit io per notes above However you need to comfirm the 64bit file io stuff really works even if it compiles.
Somebody with a definite 64bit offset capable unix should please test the current code.
As I type, there are three levels of code available for different platforms, something I hope can be cleaned up very soon.
level I:- using VMMaker-3-1-version3 and code on sourceforge tagged {er something I forget - Rob, can you elucidate oin this for us?} . I believe that this is the current state for win32.
level II:- using VMMaker-3-1-version3 and the 'latest' code on SF. This is the combination used for Mac right now.
level III:- using VMMaker-3-2-version5 and the 'latest' code on SF. This is for linux/unix right now.
The chief difference between the two versions of VMMaker is that the version5 a) generates the internal plugins' code into a subdirectory of src/vm/intplugins. This saves some problems relating to possible filename clashes between plugins under the previous regime of smooshing all the internal plugins together. b) no longer copies files from platforms/ to src/ which obviously requires some changes to makefile. Lex has done the work for linux already, the other platforms are still being worked on. The main benefit here is that there is no confusion as to which file you edit whilst doing active development. It also sidesteps the problem of Squeak's inability to handle file attributes well.
tim, enjoying a spectacular mountain sunsset on the deck overlooking a nice valley that I own a part of :-)