[M3devel] Getting IsLittleEndian as a Modula-3 CONST

Dragiša Durić dragisha at m3w.org
Sun May 26 21:54:15 CEST 2013


My first idea (very fast&dirty) was

CONST
  BigEndian = LOOPHOLE(1, ARRAY[0..7] OF BITS 8 FOR [0..255])[0] = 0;

But this is not constant expression, so says cm3 :).

--
Dragiša Durić
dragisha at m3w.org



On May 26, 2013, at 8:47 PM, Rodney M. Bates wrote:

> I know this can be done using m3makefiles and the build system, but I
> am hoping someone can point to a place where it already exists.  I need
> a Module-3 CONST that tells endianness of the machine we are running
> on, that is available to code in m3core.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20130526/29522ba6/attachment-0002.html>


More information about the M3devel mailing list