Schatzl Thomas wrote:
This will never compile directly on 64 bit platforms (x64/ppc64) because afaik sizeof(enum) always <> sizeof(tobject) there. The original poster didn't mention his platform afaik.
Sorry, Sean was out of the office yesterday.
Boian hit it exactly; we're doing this cast to store values in the TStrings Objects[] property. The current platform we're targeting is Linux 32-bit, but we'll probably go to 64-bit at some point too, and it would be nice if the cast continued to work as is.
AFAIK, none of the original Delphi code uses MinEnumSize, so it does work there with 1 and 2 byte enumerations as well.
Craig _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel