[AD] Allegro on 64-bit platforms |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Now that 64-bit computing is becoming mainstream thanks to AMD64, I think it
is time to make Allegro 64-bit clean. The library already compiles with GCC
in strict mode on AMD64/Linux (thanks to Philipp Thomas from SUSE) but I
don't think it really works. It also compiles on SPARC64/Solaris.
The first goal is to make it work with GCC. On 64-bit platforms, GCC is
almost always LP64 (32-bit int, 64-bit long, 64-bit pointer). I've attached
the (purged of noise) result of grep "long" on allegro._tx. The good news
is that there are not many problems; but some are deeply rooted in the
library (e.g. the use of 'long' for 32-bit pixel values).
I think a reasonable approach is to try not to make incompatible changes on
32-bit platforms and break compatibility as much as we need on 64-bit
platforms. We could even think of backporting the work to the stable
branch.
--
Eric Botcazou
@@typedef long @fixed
long size; - size of file
long size; - size of the data in bytes
unsigned long len; - length (in samples)
unsigned long loop_start; - loop start position
unsigned long loop_end; - loop finish position
@@long @ustrtol(const char *s, char **endp, int base);
Returns the string converted as a value of type `long int'. If nothing was
@@void @rest(long time);
@@void @rest_callback(long time, void (*callback)())
in 32-bit modes sizeof(long) bytes per pixel). You can create and manipulate
unsigned long (*BLENDER_FUNC)(unsigned long x, y, n);<endblock>
((long *)bmp->line[y])[x] = color;
bmp_write8((unsigned long)bmp->line[y]+x, color);
unsigned long bmp_write_line(BITMAP *bmp, int line);<br>
unsigned long bmp_read_line(BITMAP *bmp, int line);<br>
unsigned long bmp_unwrite_line(BITMAP *bmp);<br>
coordinate to the returned address. The return value is an unsigned long
unsigned long address = bmp_write_line(bmp, y);
bmp_write8((unsigned long)bmp->line[y]+(x>>2), color);
unsigned long screen_base_addr;
unsigned long loop_start;
unsigned long loop_end;
@@extern volatile long @midi_pos;
@@extern long @midi_loop_start;
@@extern long @midi_loop_end;
@@long @file_size(const char *filename);
long size; - size of file
@@long @pack_igetl(PACKFILE *f);
Like pack_getc, but reads a 32-bit long from a file, using Intel byte
@@long @pack_iputl(long c, PACKFILE *f);
Like pack_putc, but writes a 32-bit long to a file, using Intel byte
@@long @pack_mgetl(PACKFILE *f);
Like pack_getc, but reads a 32-bit long from a file, using Motorola byte
@@long @pack_mputl(long c, PACKFILE *f);
Like pack_putc, but writes a 32-bit long to a file, using Motorola byte
@@long @pack_fread(void *p, long n, PACKFILE *f);
@@long @pack_fwrite(const void *p, long n, PACKFILE *f);
@\void @register_datafile_object(int id, void *(*load)(PACKFILE *f, long size),
long size; - size of the data in bytes
Defined to whatever represents a 64-bit "long long" integer for the